PHP time_sleep_until() Function

Definition and Usage

The time_sleep_until() function delays the execution of the code until the specified time.

Syntax

time_sleep_until(timestamp)
Parameters Description
timestamp Required. The timestamp when the script wakes up.

Description

Suspends script execution until the specified timestamp.

Return Value

Returns TRUE if successful, FALSE if failed.

Errors/Exceptions

If the timestamp specified is in the past, the function will generate an E_WARNING.

Tips and Comments

Note:All signals will be delivered after the script wakes up.

Note:This function is not implemented on the Windows platform.

Example

?>php
// Wake up after 10 seconds from now
time_sleep_until(time()+10);
?>