time_nanosleep
Delay execution for several seconds and nanoseconds
time_nanosleep()
function delays the execution of the current script by the specified number of seconds and nanoseconds.
Note: On Windows, the system's sleep time may exceed the specified number of nanoseconds, depending on the hardware.
Delay the execution of the current script by 3.5 seconds:
<?php if ( time_nanosleep ( 3 , 500000000 ) === true ) { echo "Pause for 3 and a half seconds" ; } ?>
Try it yourself
time_nanosleep ( seconds , nanoseconds )
parameter | describe |
---|---|
seconds | Required. Specifies the number of seconds to delay the script. |
nanoseconds | Required. Specifies the number of nanoseconds to delay the script (must be less than 1,000,000,000). |
Delays the program execution of the specified number of seconds and nanoseconds .
Return TRUE if successful, and FALSE if failed
If the delay is interrupted by a signal, an associative array with the following components is returned: