改进运行时间显示精度

This commit is contained in:
thinkphp
2016-07-03 16:19:21 +08:00
parent e40c06e548
commit 87539871c5
3 changed files with 8 additions and 8 deletions

View File

@@ -68,15 +68,15 @@ class Socket
}
$runtime = number_format(microtime(true), 8, '.', '') - THINK_START_TIME;
$reqs = number_format(1 / number_format($runtime, 8), 2);
$time_str = " [运行时间:{$runtime}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_str = " [内存消耗:{$memory_use}kb]";
$file_load = " [文件加载:" . count(get_included_files()) . "]";
$memory_str = ' [内存消耗:' . $memory_use . 'kb]';
$file_load = ' [文件加载:' . count(get_included_files()) . ']';
if (isset($_SERVER['HTTP_HOST'])) {
$current_uri = $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
} else {
$current_uri = "cmd:" . implode(' ', $_SERVER['argv']);
$current_uri = 'cmd:' . implode(' ', $_SERVER['argv']);
}
// 基本信息
$trace[] = [