Gen. partnerAlgotech

PHP function sleep()

Script sleep.

|
September 11, 2019

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

Official documentation of the sleep function

Loading comments...

Stay in the loop

Subscribe to our newsletter and get the latest cybersecurity news delivered straight to your inbox.

Your data is safe. You can unsubscribe from the newsletter at any time.