
- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
sleep() function in PHP
The sleep() function delays execution of the current script for short time period.
Syntax
sleep(sec)
Parameters
sec− The number of seconds to delay the script.
Return
The sleep() function returns zero on success.
Example
<?php echo date('h:i:s') . "<br>"; // wait for 10 seconds sleep(10); echo date('h:i:s') . "<br>"; // wait for 5 seconds sleep(5); echo date('h:i:s'); ?>
Output
The following is the output.
02:54:50 02:54:52 02:54:57
- Related Questions & Answers
- JavaScript Sleep() function?
- Deep sleep in Arduino
- file_exists() function in PHP
- basename( ) function in PHP
- chgrp()function in PHP
- chmod() function in PHP
- chown() function in PHP
- clearstatcache() function in PHP
- copy() function in PHP
- delete() function in PHP
- dirname()function in PHP
- disk_free_space() function in PHP
- disk_total_space() function in PHP
- diskfreespace() function in PHP
- fclose() function in PHP
Advertisements