SLEEP(1) General Commands Manual SLEEP(1)

sleepdo nothing, slowly

sleep [--] delay[]…

Sleep for the time(s) specified. Each delay is a floating-point amount of seconds, optionally suffixed with one of the following cumulative multipliers:

(econds)
(inutes)
(hours)
(ays)
(eeks)
(ears)
/ 7

Wait a half-second:

sleep 0.5
sleep 1.388e-4h

Wait a year:

sleep 1y
sleep 3.1e+7

Wait infinitely, or until the heat death of the universe:

sleep INF
sleep 10e+100y

nanosleep(2)

Conforms to IEEE Std 1003.1-2008 (“POSIX.1”), which only allows a single non-negative decimal integer delay. Multiple, floating-point delays and suffixes are extensions, originating from the GNU system. suffixes are extensions.

sleep(II) ("delay execution") appeared in Version 2 AT&T UNIX:

With the BUGS noting accuracy up to 25660=4.2(6) seconds, and the process being also placed on a low-priority queue for the duration of the sleep.

Version 3 AT&T UNIX sleep(II) takes whole seconds, but the precision limitations remain.

Version 4 AT&T UNIX sees full-range sleep(II), and sleep(I) — "suspend execution for an interval", limited to (16 bits, unsigned, but it's more likely actually , int) seconds (this is noted in the BUGS, despite being entirely expected with a 16-bit r0 on a 16-bit machine).

Version 7 AT&T UNIX replaces sleep(II) with ftime(2) and implements sleep(3), based on alarm(2), pause(2), and longjmp(3), in Standard C Library (libc, -lc), but leaves sleep unchanged.

Version 7 AT&T UNIX/32V just blindly updates the BUGS to say that the max is seconds. Considering this is now 68 , rather than the 18ish hours (or, indeed, 9ish, as the case may be), this raises question about the fore-seen use-cases.

This sleep implementation persists into AT&T UNIX and the BSD (but Version 3 AT&T UNIX and 4.2BSD cool it on the longjmp(3)s in sleep(3)), and is standardised verbatim in X/Open Portability Guide Issue 2 (“XPG2”).

November 27, 2022 voreutils pre-v0.0.0-latest