php man page for time_nanosleep

Query: time_nanosleep

OS: php

Section: 3

Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar

TIME_NANOSLEEP(3)							 1							 TIME_NANOSLEEP(3)

time_nanosleep - Delay for a number of seconds and nanoseconds

SYNOPSIS
mixed time_nanosleep (int $seconds, int $nanoseconds)
DESCRIPTION
Delays program execution for the given number of $seconds and $nanoseconds.
PARAMETERS
o $seconds - Must be a non-negative integer. o $nanoseconds - Must be a non-negative integer less than 1 billion.
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: o seconds - number of seconds remaining in the delay o nanoseconds - number of nanoseconds remaining in the delay
CHANGELOG
+--------+---------------------------------------------------+ |Version | | | | | | | Description | | | | +--------+---------------------------------------------------+ | 5.3.0 | | | | | | | This function is now available on Windows plat- | | | forms. | | | | +--------+---------------------------------------------------+
EXAMPLES
Example #1 time_nanosleep(3) example <?php // Careful! This won't work as expected if an array is returned if (time_nanosleep(0, 500000000)) { echo "Slept for half a second. "; } // This is better: if (time_nanosleep(0, 500000000) === true) { echo "Slept for half a second. "; } // And this is the best: $nano = time_nanosleep(2, 100000); if ($nano === true) { echo "Slept for 2 seconds, 100 microseconds. "; } elseif ($nano === false) { echo "Sleeping failed. "; } elseif (is_array($nano)) { $seconds = $nano['seconds']; $nanoseconds = $nano['nanoseconds']; echo "Interrupted by a signal. "; echo "Time remaining: $seconds seconds, $nanoseconds nanoseconds."; } ?>
SEE ALSO
sleep(3), usleep(3), time_sleep_until(3), set_time_limit(3). PHP Documentation Group TIME_NANOSLEEP(3)
Related Man Pages
std::chrono(3) - centos
nanosleep(2) - redhat
round(3) - php
time_nanosleep(3) - php
datetime::format::epoch(3pm) - debian
Similar Topics in the Unix Linux Community
seconds to hh:mm:ss
microwindow and nano-X
Division returning a negative number
Nano ; does it have split screen capability?
Delay of upto 7 seconds after typing in putty