Skip to content

Commit fa0c8e1

Browse files
committed
Adjust sleeping logic
1 parent 38ec796 commit fa0c8e1

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tests/BaseTestCase.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,12 @@ protected function sleep(float $seconds): void
3939
{
4040
$wholeSeconds = (int) $seconds;
4141
$fractionalSeconds = $seconds - $wholeSeconds;
42-
sleep($wholeSeconds);
43-
usleep($fractionalSeconds * 1000000);
42+
if ($wholeSeconds > 0) {
43+
sleep($wholeSeconds);
44+
}
45+
if ($fractionalSeconds > 0) {
46+
usleep($fractionalSeconds * 1000000);
47+
}
4448
}
4549

4650
// ---

0 commit comments

Comments
 (0)