W3Schools.com

PHP sleep() Function


PHP Misc Reference Complete PHP Misc Reference

Definition and Usage

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

Syntax

sleep(seconds)

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


Example

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

//sleep for 10 seconds
sleep(10);

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

?>

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

11:00:07
11:00:17


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
$7.95/mo SEO Hosting
Premium Website Design
WEB BUILDING
XML Editor - Free Trial!
FREE Website BUILDER
Free Website Templates Free CSS Templates
Make Your Own Website
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