3 ms·
PHP offers sleep[1] and usleep[2] which sleep for a period in either seconds or microseconds respectively. I don't know why every other programming language ev
by munk-a 5y ago
PHP offers sleep[1] and usleep[2] which sleep for a period in either seconds or microseconds respectively. I don't know why every other programming language ever hasn't adopted this habit. (There's also time_nanosleep[3] which definitely could be better defined, but it's PHP, sleeping for some amount of time between a nanosecond and a microsecond is pretty hilarious when you're running on an interpreter).
1. https://www.php.net/manual/en/function.sleep.php https://www.php.net/manual/en/function.sleep.php
2. https://www.php.net/manual/en/function.usleep.php https://www.php.net/manual/en/function.usleep.php
3. https://www.php.net/manual/en/function.time-nanosleep.php https://www.php.net/manual/en/function.time-nanosleep.php