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

Comments:Before PHP 5, this function cannot work on Windows systems.

Comments:One microsecond is equal to one millionth of a second.

Example

<?php
echo date('h:i:s') . "<br />";
//Delay 10 description
usleep(10000000);
//Start again
echo date('h:i:s');
?>

Output:

09:23:14
09:23:24