PHP sleep() Function

The sleep() function delays execution of the current script for a specified number of seconds.

int sleep ( int $seconds )

Delays the program execution for the given number of seconds.

Example -

This example will output (after 10 seconds)

05:31:23
05:31:33

ParameterDescription
secondsRequired. Specifies the number of seconds to delay the script

Return Values

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.