From 8c5b6f674c6c40c948d65f4d330de62a3b1adc1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Thu, 16 Sep 2021 14:48:54 +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 --- http-server/Service/Http.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/http-server/Service/Http.php b/http-server/Service/Http.php index c420c5f7..9473eaa5 100644 --- a/http-server/Service/Http.php +++ b/http-server/Service/Http.php @@ -64,7 +64,11 @@ class Http extends \Server\Abstracts\Http implements OnClose, OnConnect */ private function _runTime(Request $request): float { - return round(microtime(true) - ($request->server['request_time_float'] - $request->server['request_time']), 6); + $float = microtime(true) - time(); + + $rTime = $request->server['request_time_float'] - $request->server['request_time']; + + return round($float - $rTime, 6); }