This repository has been archived on 2024-03-28. You can view files and clone it, but cannot push or open issues or pull requests.
dotfiles/bin/sw

16 lines
290 B
Text
Raw Normal View History

2019-09-25 07:16:15 -05:00
#!/usr/bin/env bash
d="$(date +%s)"
echo "Stopwatch started $(date)"
while true; do
_dt=$((`date +%s` - d))
days=$((_dt / 86400))
echo -ne "\r${days}d $(date -u --date @$((_dt)) +%H:%M:%S) "
sleep 0.1
done
2019-10-31 12:42:25 -05:00
# TODO: add "lap" capabilities?
echo -ne "\rStopwatch stopped at $(date)\n"