Skip to content

Commit 669952d

Browse files
authored
fix: load time (#17)
1 parent 1ec1d02 commit 669952d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/OutputBufferingResponseDataProvider.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function getResponse(): Response
3232
return new Response(
3333
code: is_int($responseCode) ? $responseCode : 200,
3434
size: $responseSize,
35-
load_time: $this->getLoadTime(),
35+
load_time: $this->getLoadTimeInMilliseconds(),
3636
body: $responseBody,
3737
headers: $this->getResponseHeaders(),
3838
);
@@ -59,10 +59,10 @@ private function getResponseHeaders(): array
5959
/**
6060
* Calculate the execution time for the script.
6161
*/
62-
private function getLoadTime(): float
62+
private function getLoadTimeInMilliseconds(): float
6363
{
6464
if (isset($_SERVER['REQUEST_TIME_FLOAT'])) {
65-
return (float) microtime(true) - $_SERVER['REQUEST_TIME_FLOAT'];
65+
return (microtime(true) * 1000) - ((float)$_SERVER['REQUEST_TIME_FLOAT'] * 1000);
6666
}
6767

6868
return 0.0000;

0 commit comments

Comments
 (0)