PHP time_sleep_until() Function

Definition and Usage

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

Syntax

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

Description

Suspends script execution until the specified timestamp.

Return Value

Returns TRUE on success, FALSE on failure.

Error/Exception

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 in 10 seconds from now
time_sleep_until(time()+10);
?>