PHP usleep() Function
Definition and Usage
The usleep() function delays the execution of the code for several microseconds.
Syntax
usleep(microseconds)
Parameter | Description |
---|---|
microseconds | Required. The pause time in microseconds. |
Return Value
No return value.
Tips and Comments
Comment:Before PHP 5, this function does not work on Windows systems.
Comment:One microsecond is equal to one millionth of a second.
Example
<?php echo date('h:i:s') . "<br />"; //Delay 10 Description usleep(10000000); //Restart again echo date('h:i:s'); ?>
Output:
09:23:14 09:23:24