提高runtime的计算精度 避免吞吐率出现Division by zero错误

This commit is contained in:
thinkphp
2016-03-22 10:50:12 +08:00
parent 086fa8e9dd
commit abeafb4ab7
4 changed files with 8 additions and 4 deletions

View File

@@ -43,8 +43,9 @@ class Trace
return false;
}
// 获取基本信息
$runtime = number_format(microtime(true) - START_TIME, 6);
$runtime = microtime(true) - START_TIME;
$reqs = number_format(1 / $runtime, 2);
$runtime = number_format($runtime, 6);
$mem = number_format((memory_get_usage() - START_MEM) / 1024, 2);
// 页面Trace信息