From 5c4cadc23caf6ccb023c57eccbcf84e4b35d9eac Mon Sep 17 00:00:00 2001 From: thinkphp Date: Thu, 7 Jul 2016 22:54:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9BFile=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E9=A9=B1=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/log/driver/File.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/library/think/log/driver/File.php b/library/think/log/driver/File.php index a540aac0..bbc9b76e 100644 --- a/library/think/log/driver/File.php +++ b/library/think/log/driver/File.php @@ -54,12 +54,12 @@ class File } else { $current_uri = "cmd:" . implode(' ', $_SERVER['argv']); } - $runtime = number_format(microtime(true), 8, '.', '') - THINK_START_TIME; - $reqs = number_format(1 / $runtime, 2); - $time_str = " [运行时间:{$runtime}s] [吞吐率:{$reqs}req/s]"; + $runtime = (number_format(microtime(true), 8, '.', '') - THINK_START_TIME) ?: 0.00000001; + $reqs = number_format(1 / number_format($runtime, 8), 2); + $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()) . ']'; $info = '[ log ] ' . $current_uri . $time_str . $memory_str . $file_load . "\r\n"; foreach ($log as $type => $val) {