time_nanosleep

PHP 5, PHP 7, PHP 8
time_nanosleep - Delay for a number of seconds and nanoseconds
Manual
Code Examples

time_nanosleep( int$seconds, int$nanoseconds ): array|bool

Delays program execution for the given number of seconds and nanoseconds.

Parameters

seconds

Must be a non-negative integer.

nanoseconds

Must be a non-negative integer less than 1 billion.

Note:

On Windows, the system may sleep longer that the given number of nanoseconds, depending on the hardware.

Return Values

Returns true on success or false on failure.

If the delay was interrupted by a signal, an associative array will be returned with the components:

seconds - number of seconds remaining in the delay

nanoseconds - number of nanoseconds remaining in the delay

Related Functions

Example of time_nanosleep

Show all examples for time_nanosleep

PHP Version: