Search w3schools.com:

SHARE THIS PAGE

PHP usleep() Function


PHP Misc Reference Complete PHP Misc Reference

Definition and Usage

The usleep() function delays execution of the current script for a specified number of microseconds (a microsecond equals one millionth of a second).

Syntax

usleep(microseconds)

Parameter Description
microseconds Required. Specifies the number of microseconds to delay the script


Tips and Notes

Note: This function did not work on Windows platforms until PHP 5.


Example

<?php
echo date('h:i:s') . "<br />";

//sleep for 10 seconds
usleep(10000000);

//start again
echo date('h:i:s');
?>

The output of the code above will be something like this:

09:23:14
09:23:24


PHP Misc Reference Complete PHP Misc Reference

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]