tai64n
1
user commands
djbwares
tai64n
puts a precise timestamp on each line.
tai64n
Description
tai64n reads lines from stdin.
For each line, it writes
an @,
a precise timestamp,
a space, and
a copy of the input line
to stdout.
The timestamp indicates the moment that tai64n read the first character of the line.
tai64n does not allocate any memory after it starts.
Timestamps
Timestamps used by tai64n are 12-byte TAI64N labels in external TAI64N format, printed as 24 lowercase hexadecimal characters.
You can use tai64nlocal1 to convert the timestamps to a human-readable format.
For example, the timestamp 4000000037c219bf2ef02e94 refers to the nanosecond beginning exactly 935467455.787492500 seconds after the beginning of 1970 TAI; 37c219bf hexadecimal is 935467455, and 2ef02e94 hexadecimal is 787492500.
The current implementation of tai64n relies on the UNIX gettimeofday3 library routine to return the current time as the number of TAI seconds since 1970-01-01 00:00:10 TAI.
Because it does, this implementation only has a resolution of microseconds, adding 500 nanoseconds to each UNIX time that it obtains so that every timestamp is halfway through a microsecond.
Beware that most gettimeofday()
implementations are not Y2038-compliant.
Furthermore, most clocks are not set accurately.
Exit codes
tai64n exits 0 when it sees end of input.
It exits 111 without an error message if it has trouble reading stdin or writing stdout.
See also
supervise1
svc1
svok1
svstat1
svscanboot1
svscan1
readproctitle1
fghack1
pgrphack1
multilog1
tai64nlocal1
setuidgid1
envuidgid1
envdir1
softlimit1
setlock1
Author
Original code and documentation by Daniel J. Bernstein.
Converted to manual pages and updated by GerritPape in 2000, 2001, and 2002.
Converted to DocBook XML by Jonathan de Boyne Pollard.