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)
Parameter 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.

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
// From now on 10 seconds later wake up
time_sleep_until(time()+10);
?>