Current Location: Home> Function Categories> time_sleep_until

time_sleep_until

Make the script sleep until the specified time
Name:time_sleep_until
Category:Miscellaneous
Programming Language:php
One-line Description:Makes the script sleep for a specified time.

Definition and usage

The time_sleep_until() function is used to sleep the script for a specified time.

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

Example

Let the script sleep for 3 seconds:

 <?php
// Wake up after 3 seconds from now
time_sleep_until ( time ( ) + 3 ) ;
echo "Hello" ;
?>

Try it yourself

grammar

 time_sleep_until ( timestamp )
parameter describe
timestamp Required. Specifies the timestamp of when the script should wake up.

illustrate

Makes the script pause execution until the specified timestamp .

Return value

If successful, return TRUE, and if failed, return FALSE.

Error/Exception

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

Similar Functions
Popular Articles