PHP function sleep()
Script sleep.
Availability in PHP 4.0
Script sleep.
Parameters
| Parameter | Data type | Default value | Note |
|---|---|---|---|
$seconds |
int |
not | How long to sleep in seconds. |
Return values
int
Returns zero (0) if correct, or false if incorrect.
If the sleep was artificially interrupted, it returns the number of seconds missing until the end of the sleep.
echo 'Hello!'; // Printed immediately
sleep(3); // Script will be paused for 3 seconds
echo 'How are you?'; // Printed after 3 seconds
Other resources
Loading comments...