blob: d908e63ee4e97a0132a267aef1c56164a662acf7 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
NAME
sleep-until – sleeps until a specified time
SYNOPSIS
sleep-until CLOCKNAME... TIMEPOINT...
DESCRIPTION
Pause until TIMEPOINT. TIMEPOINT is the number of seconds
since Epoch, in UTC but not accounting for leap seconds,
by default. If CLOCKNAME is specifed, TIMEPOINT is the
number of seconds since the zerotime of that clock.
TIMEPOINT may be an arbitrary floating point number.
Pause is continued when interrupted.
On Linux 4.2.2 the clocks that can be used are:
* CLOCK_REALTIME
* CLOCK_MONOTONIC
* CLOCK_BOOTTIME
* CLOCK_REALTIME_ALARM
* CLOCK_BOOTTIME_ALARM
Note that the neither course clocks, CLOCK_MONOTONIC_RAW
(the proper implementation of a monotonic clock), and
CLOCK_TAI does not work.
RATIONALE
Previously, the best wait to sleep until a specific time
was to use date, sleep, and arithmetics in Bash. This is
very inconvenient, and only allows sleep over a monotonic
clock.
This progam was written so that the author could combine
it with mplayer to construct a custom alarm clock.
SEE ALSO
sleep(1), date(1)
|