改进命令行模式下 日志写入出错的问题

This commit is contained in:
thinkphp
2016-12-16 14:34:44 +08:00
parent 47a0cf5b06
commit 3cfd718c38
3 changed files with 8 additions and 8 deletions

View File

@@ -63,7 +63,7 @@ class File
$current_uri = "cmd:" . implode(' ', $_SERVER['argv']);
}
$runtime = number_format(microtime(true) - THINK_START_TIME, 10);
$runtime = round(microtime(true) - THINK_START_TIME, 10);
$reqs = $runtime > 0 ? number_format(1 / $runtime, 2) : '∞';
$time_str = ' [运行时间:' . number_format($runtime, 6) . 's][吞吐率:' . $reqs . 'req/s]';
$memory_use = number_format((memory_get_usage() - THINK_START_MEM) / 1024, 2);

View File

@@ -65,7 +65,7 @@ class Socket
}
$trace = [];
if (App::$debug) {
$runtime = number_format(microtime(true) - THINK_START_TIME, 10);
$runtime = round(microtime(true) - THINK_START_TIME, 10);
$reqs = $runtime > 0 ? number_format(1 / $runtime, 2) : '∞';
$time_str = ' [运行时间:' . number_format($runtime, 6) . 's][吞吐率:' . $reqs . 'req/s]';
$memory_use = number_format((memory_get_usage() - THINK_START_MEM) / 1024, 2);