From d743382868eea64bf65507fed521c6550f18d138 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Fri, 19 Nov 2021 11:24:08 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- function.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/function.php b/function.php index 1133c01d..39d52582 100644 --- a/function.php +++ b/function.php @@ -17,7 +17,6 @@ use Kiri\Exception\ConfigException; use Kiri\Exception\NotFindClassException; use Kiri\Kiri; use Psr\Log\LoggerInterface; -use Server\ServerManager; use Swoole\Process; use Swoole\WebSocket\Server; @@ -157,7 +156,9 @@ if (!function_exists('now')) { */ function now(): string { - return date('Y-m-d H:i:s') . '.' . str_replace(time() . '.', '', (string)microtime(true)); + $sprintf = sprintf('%04d', microtime(true)); + + return date('Y-m-d H:i:s') . '.' . str_replace(time() . '.', '', $sprintf); } }