From 7d31929283fe879eb4f190d2a46abf2b66db3639 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Thu, 16 Sep 2021 14:20:10 +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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/http-server/Service/Http.php b/http-server/Service/Http.php index 67d20f32..a2f9ef1e 100644 --- a/http-server/Service/Http.php +++ b/http-server/Service/Http.php @@ -41,6 +41,7 @@ class Http extends \Server\Abstracts\Http implements OnClose, OnConnect */ public function onRequest(Request $request, Response $response): void { + $request_time_float = microtime(true); try { $node = $this->router->radix_tree($Psr7Request = ScRequest::create($request)); if (!($node instanceof Node)) { @@ -52,7 +53,6 @@ class Http extends \Server\Abstracts\Http implements OnClose, OnConnect } catch (Error | \Throwable $exception) { $psr7Response = $this->exceptionHandler->emit($exception, $this->response); } finally { - $request_time_float = $request->server['request_time_float'] - $request->server['request_time']; $psr7Response->withHeader('Run-Time', microtime(true) - $request_time_float); $this->responseEmitter->sender($response, $psr7Response); $this->eventDispatch->dispatch(new OnAfterRequest());