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); } }