"; // Delay"> "; // Delay" />
Easy Tutorial
❮ Pdostatement Fetchall Php Imageantialias ❯

PHP sleep() Function

PHP Misc Reference Manual

Example

Delay the execution of the current script by 5 seconds:

<?php
echo date('h:i:s') . "<br>";

// Delay by 5 seconds
sleep(5);

// Output the time again
echo date('h:i:s');
?>

Definition and Usage

The sleep() function delays the execution of the current script for a specified number of seconds.

Note: If the specified number of seconds is negative, the function will throw an error.


Syntax

sleep(seconds)
Parameter Description
seconds Required. Specifies the number of seconds to delay the script execution.

Technical Details

Return Value: Returns 0 if successful, or FALSE on error. <br> <br>If the call is interrupted by a signal, the function returns a non-zero value. On Windows platforms, this value will always be 192, which is the value of the WAIT_IO_COMPLETION constant in the Windows API. On other platforms, the return value will be the remaining number of seconds of the delay.
PHP Version: 4+
--- ---
Changelog: Prior to PHP 5.3.4, when called on Windows platforms, this function always returned NULL.
--- ---
❮ Pdostatement Fetchall Php Imageantialias ❯