usleep

void usleep(integer microseconds) 

Delays program execution.

Returns:

Nothing

Description:

usleep() is used to delay the execution of the current program. The delay lasts for the number of microseconds specified in the microseconds argument and begins at the point in the script where the usleep() function call is made.

Note:

usleep() does not work on some operating systems (notably most Windows family operating systems).

Availability:

UNIX/Linux, Windows

Version:

3+, 4+

See also:

To sleep for a number of seconds:

sleep() 

Example:

Use usleep() to reduce the effectiveness of lottery-style password attacks
<?php 
# Sleep for 1/2 second 
microsleep (500); 

# Attempt to authenticate user data 
# ... 
?> 

Get PHP Functions Essential Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.