PHP usleep() Function
Example
Delay execution of the current script by 5 seconds (5,000,000 microseconds):
" ; // sleep for 5 seconds usleep ( 5000000 ) ; // start again echo date ( ' h:i:s ' ) ; ?>Run Example »
Definition and Usage
The usleep() function delays execution of the current script by a number of microseconds (one microsecond equals one millionth of a second).
**Note:** If the specified number of seconds is negative, this function will throw an error.
Syntax
usleep(
microseconds
)
| Parameters | Description |
|---|---|
| microseconds | Required. Specifies the number of microseconds to delay script execution. |
Technical Details
| Return Value: | No value is returned. |
|---|---|
| PHP Version: | 4+ |
| Changelog: | This function was not implemented on Windows platforms until PHP 5. |
PHP Misc Reference Manual