Current Location: Home> Function Categories> usleep

usleep

Delay execution with specified number of microseconds
Name:usleep
Category:Miscellaneous
Programming Language:php
One-line Description:Delay code execution by the specified number of microseconds.

Definition and usage

The usleep() function delays the execution of the current script by the specified number of microseconds (one microsecond is equal to one millionth of a second).

Example

Delay the current script execution by 3 seconds (30000000 microseconds):

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

// Pause for 3 seconds
usleep ( 3000000 ) ;

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

Try it yourself

grammar

 usleep ( microseconds )
parameter describe
microseconds Required. Specifies the number of microseconds for the delay script.

Return value

No return value.

Similar Functions
Popular Articles