Skip to content

Commit 3c0e7e9

Browse files
fix wrong computation
1 parent ab7adb8 commit 3c0e7e9

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/CustomSleepMixin.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ protected static function customSleep(float|int $delay): void
1616
}
1717

1818
$seconds = intval($delay);
19-
$micros = (int) round(((float) $delay - $seconds) * 1_000_000);
19+
$micros = (int) round(($delay - (float) $seconds) * 1_000_000);
2020
if ($seconds > 0) {
2121
sleep($seconds);
2222
}
2323
if ($micros > 0) {
24-
usleep($micros * 1_000_000);
24+
usleep($micros);
2525
}
2626
}
2727
}

0 commit comments

Comments
 (0)