Skip to content

Commit cbef652

Browse files
Remove prefix of microtime and usleep, is used by PHPMock
1 parent 44a1216 commit cbef652

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

classes/util/Loop.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public function execute(callable $code)
8484
/*
8585
* Calculate max time remaining, don't sleep any longer than that.
8686
*/
87-
$usecRemaining = \intval(($timeout - \microtime(true)) * 1e6);
87+
$usecRemaining = \intval(($timeout - microtime(true)) * 1e6);
8888

8989
if ($usecRemaining <= 0) {
9090
/*
@@ -95,10 +95,10 @@ public function execute(callable $code)
9595

9696
$usleep = \min($usecRemaining, \random_int($min, $max));
9797

98-
\usleep($usleep);
98+
usleep($usleep);
9999
}
100100

101-
if (\microtime(true) >= $timeout) {
101+
if (microtime(true) >= $timeout) {
102102
throw new TimeoutException("Timeout of $this->timeout seconds exceeded.");
103103
}
104104

0 commit comments

Comments
 (0)