Menu Home

usleep

osbo.com | PHP | Functions | usleep

Delay execution in microseconds

Syntax

usleep ( int $micro_seconds ) : void

Parameters

micro_seconds

Halt time in microseconds. A microsecond is one millionth of a second.

Note: On Windows, the system may sleep longer that the given number of microseconds, depending on the hardware.

Return

No value is returned.

Examples

<?

echo date('h:i:s') . "\n";

$micro_seconds = 1000000;
usleep($micro_seconds);

echo date('h:i:s');

?>
10:32:00
10:32:01

PHP