PHP function 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.
php
echo 'Hello!'; // Printed immediatelysleep(3); // Script will be paused for 3 secondsecho 'How are you?'; // Printed after 3 seconds