
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
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
usleep() function in PHP
The usleep() function delays execution of the current script for few microseconds.
Syntax
usleep(msec)
Parameters
msec − The number of microseconds to delay the script.
Return
The usleep() function returns nothing.
Example
<?php echo date('h:i:s') . "<br>"; // wait for 2 seconds usleep(2000000); echo date('h:i:s') . "<br>"; // wait for 5 seconds usleep(5000000); echo date('h:i:s'); ?>
Output
The following is the output.
03:06:08 03:06:10 03:06:15
Advertisements