Skip to content

Commit 7e55e9b

Browse files
authored
Remove µs string before multiply, fix return type (#227)
Co-authored-by: Andrej Mihaliak <[email protected]>
1 parent 4a3301a commit 7e55e9b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Commands/StartRoadRunnerCommand.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ protected function writeServerOutput($server)
196196
* Calculate the elapsed time for a request.
197197
*
198198
* @param string $elapsed
199-
* @return int
199+
* @return float
200200
*/
201201
protected function calculateElapsedTime(string $elapsed): float
202202
{
@@ -205,10 +205,10 @@ protected function calculateElapsedTime(string $elapsed): float
205205
}
206206

207207
if (Str::endsWith($elapsed, 'µs')) {
208-
return $elapsed * 0.001;
208+
return mb_substr($elapsed, 0, -2) * 0.001;
209209
}
210210

211-
return $elapsed * 1000;
211+
return (float)$elapsed * 1000;
212212
}
213213

214214
/**

0 commit comments

Comments
 (0)