改进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

@@ -65,9 +65,8 @@ class Socket
if (!$this->check()) {
return false;
}
$runtime = microtime(true) - START_TIME;
$runtime = microtime_float() - START_TIME;
$reqs = number_format(1 / number_format($runtime, 8), 2);
$runtime = number_format($runtime, 6);
$time_str = " [运行时间:{$runtime}s][吞吐率:{$reqs}req/s]";
$memory_use = number_format((memory_get_usage() - START_MEM) / 1024, 2);
$memory_str = " [内存消耗:{$memory_use}kb]";