Difference among sleep() and usleep() in PHP
sleep()
allows your code to sleep in seconds.
sleep(5); // sleeps for 5 seconds
usleep()
allows your code with respect to microseconds.
usleep(2500000); // sleeps for 2.5 seconds
The argument to sleep
is seconds, the argument to usleep
is microseconds. Other than that, I think they're identical.
sleep($n) == usleep($n * 1000000)
usleep(25000)
only sleeps for 0.025 seconds.