W3Schools.com

PHP usleep() Function


PHP Misc Reference Complete PHP Misc Reference

Definition and Usage

The usleep() function delays execution of the current script for a specified number of microseconds (a microsecond equals one millionth of a second).

Syntax

usleep(microseconds)

Parameter Description
microseconds Required. Specifies the number of microseconds to delay the script


Tips and Notes

Note: This function did not work on Windows platforms until PHP 5.


Example

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

//sleep for 10 seconds
usleep(10000000);

//start again
echo date('h:i:s');
?>

The output of the code above will be something like this:

09:23:14
09:23:24


PHP Misc Reference Complete PHP Misc Reference
WEB HOSTING
Best Web Hosting
PHP MySQL Hosting
Best Hosting Coupons
UK Reseller Hosting
Cloud Hosting
Top Web Hosting
$3.98 Unlimited Hosting
Premium Website Design
WEB BUILDING
Download XML Editor
FREE Website BUILDER
Best Website Templates Top CSS Templates
CREATE HTML Websites
EASY WEBSITE BUILDER
W3SCHOOLS EXAMS
Get Certified in:
HTML, CSS, JavaScript, XML, PHP, and ASP
W3SCHOOLS BOOKS
New Books:
HTML, CSS
JavaScript, and Ajax
STATISTICS
Browser Statistics
Browser OS
Browser Display
SHARE THIS PAGE