mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-08 15:42:48 +08:00
改进时间计算
This commit is contained in:
@@ -54,8 +54,8 @@ class File
|
|||||||
} else {
|
} else {
|
||||||
$current_uri = "cmd:" . implode(' ', $_SERVER['argv']);
|
$current_uri = "cmd:" . implode(' ', $_SERVER['argv']);
|
||||||
}
|
}
|
||||||
$runtime = (number_format(microtime(true), 8, '.', '') - THINK_START_TIME) ?: 0.00000001;
|
$runtime = round(microtime(true) - THINK_START_TIME, 20);
|
||||||
$reqs = number_format(1 / number_format($runtime, 8), 2);
|
$reqs = number_format(1 / $runtime, 2);
|
||||||
$time_str = ' [运行时间:' . number_format($runtime, 6) . 's][吞吐率:' . $reqs . 'req/s]';
|
$time_str = ' [运行时间:' . number_format($runtime, 6) . 's][吞吐率:' . $reqs . 'req/s]';
|
||||||
$memory_use = number_format((memory_get_usage() - THINK_START_MEM) / 1024, 2);
|
$memory_use = number_format((memory_get_usage() - THINK_START_MEM) / 1024, 2);
|
||||||
$memory_str = ' [内存消耗:' . $memory_use . 'kb]';
|
$memory_str = ' [内存消耗:' . $memory_use . 'kb]';
|
||||||
|
|||||||
@@ -63,8 +63,8 @@ class Socket
|
|||||||
if (!$this->check()) {
|
if (!$this->check()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$runtime = number_format(microtime(true), 8, '.', '') - THINK_START_TIME;
|
$runtime = round(microtime(true) - THINK_START_TIME, 20);
|
||||||
$reqs = number_format(1 / number_format($runtime, 8), 2);
|
$reqs = number_format(1 / $runtime, 2);
|
||||||
$time_str = ' [运行时间:' . number_format($runtime, 6) . 's][吞吐率:' . $reqs . 'req/s]';
|
$time_str = ' [运行时间:' . number_format($runtime, 6) . 's][吞吐率:' . $reqs . 'req/s]';
|
||||||
$memory_use = number_format((memory_get_usage() - THINK_START_MEM) / 1024, 2);
|
$memory_use = number_format((memory_get_usage() - THINK_START_MEM) / 1024, 2);
|
||||||
$memory_str = ' [内存消耗:' . $memory_use . 'kb]';
|
$memory_str = ' [内存消耗:' . $memory_use . 'kb]';
|
||||||
|
|||||||
Reference in New Issue
Block a user