改进trace

This commit is contained in:
yunwuxin
2016-06-29 17:35:37 +08:00
parent d9a9599043
commit f01b2cd8b7
13 changed files with 163 additions and 129 deletions

View File

@@ -54,9 +54,8 @@ class File
} else {
$current_uri = "cmd:" . implode(' ', $_SERVER['argv']);
}
$runtime = microtime(true) - START_TIME;
$reqs = number_format(1 / number_format($runtime, 8), 2);
$runtime = number_format($runtime, 6);
$runtime = microtime_float() - START_TIME;
$reqs = number_format(1 / $runtime, 2);
$time_str = " [运行时间:{$runtime}s] [吞吐率:{$reqs}req/s]";
$memory_use = number_format((memory_get_usage() - START_MEM) / 1024, 2);
$memory_str = " [内存消耗:{$memory_use}kb]";