sleep

Delay execution

Syntax

sleep ( int $seconds ) : int

Parameters

seconds

Halt time in seconds.

Return

Returns zero on success, or FALSE on error.

If the call was interrupted by a signal, sleep() returns a non-zero value. On Windows, this value will always be 192 (the value of the WAIT_IO_COMPLETION constant within the Windows API). On other platforms, the return value will be the number of seconds left to sleep.

Examples

<?

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

$seconds = 1;
sleep($seconds);

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

?>
06:09:26
06:09:27

PHP

Home Menu