Annotate stdin with timestamps per line. A Go port of moreutils/ts and fork of kevinburke/tss.
tss
is like ts
from moreutils,
but prints relative durations (with millisecond precision) by default,
and can be shipped as a compiled binary.
Try it out:
$ (sleep 1; echo "hello"; sleep 2; echo "two sec") | tss
1.00s 1.00s hello
3.01s 2.01s two sec
The first column is the amount of time that has elapsed since the program started. The second column is the amount of time that has elapsed since the last line printed.
Note that: The demo has been created with the old docker version. The log format of docker build
is different from the latest version.
For macOS and Linux.
brew install peaceiris/tap/tss