sleep

void sleep(integer seconds) 

Delays program execution.

Returns:

Nothing

Description:

sleep() is used to delay the execution of the current program. The delay lasts for the number of seconds specified in the seconds argument and begins at the point in the script where the sleep() function call is made.

Note:

On some operating systems, sleep() is not guaranteed to delay program execution for the exact number of seconds specified. Check your system documentation and perform a few tests before relying on the precision of this function.

Availability:

UNIX/Linux, Windows

Version:

3+, 4+

See also:

To sleep for a number of microseconds:

usleep() 

Example:

Slightly inaccurate way to test the accuracy of sleep()
 <pre> <?php function time_convert ...

Get PHP Functions Essential Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.