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');

?>
02:42:56
02:42:57

__halt_compiler

connection_aborted

connection_status

constant

define

defined

die

eval

exit

highlight_file

highlight_string

hrtime

ignore_user_abort

pack

php_strip_whitespace

show_source

sys_getloadavg

time_nanosleep

time_sleep_until

uniqid

unpack

usleep

PHP

Home Menu