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 at which the script wakes up.

Description

Pause the script execution until the specified timestamp.

Return Value

Returns TRUE if successful, FALSE if not.

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