X
HOME HTML CSS JAVASCRIPT SQL PHP JQUERY ANGULAR XML ASP.NET MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

PHP time_nanosleep() Function

PHP Misc Reference PHP Misc Reference

Example

Delay execution of the current script for 3,5 seconds:

<?php
if (time_nanosleep(3,500000000) === true)
  {
  echo "Slept for three and a half a second";
  }
?>

Run example »

Definition and Usage

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


Syntax

time_nanosleep(seconds,nanoseconds)

Parameter Description
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)

Technical Details

Return Value: Returns TRUE on success, or FALSE on failure.

If the call was interrupted by a signal, an associative array will be returned with the number of seconds or nanoseconds remaining in the delay.
PHP Version: 5+
Changelog: This function did not work on Windows platforms until PHP 5.3.0


PHP Misc Reference PHP Misc Reference

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB HOSTING

UK Reseller Hosting

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates FREE Website Templates Free HTML Templates

SHARE THIS PAGE

facebook