1 /* sleep.c - Wait for a number of seconds.
3 * Copyright 2007 Rob Landley <rob@landley.net>
4 * Copyright 2012 Georgi Chorbadzhiyski <georgi@unixsol.org>
6 * See http://opengroup.org/onlinepubs/9699919799/utilities/sleep.html
8 USE_SLEEP(NEWTOY(sleep, "<1", TOYFLAG_BIN))
16 Wait before exiting. An optional suffix can be "m" (minutes), "h" (hours),
17 "d" (days), or "s" (seconds, the default).
23 depends on SLEEP && TOYBOX_FLOAT
25 Length can be a decimal fraction.
34 tv.tv_sec = xparsetime(*toys.optargs, 1000000000, &tv.tv_nsec);
35 toys.exitval = !!nanosleep(&tv, NULL);