A tiny terminal stopwatch. Counts up with millisecond precision and reads single keypresses (no Enter needed) to take laps or quit.
go build -o sw ../sw| Key | Action |
|---|---|
| Space | Freeze the current time on its own line, tagged #N, and keep counting |
| q or Ctrl-C | Print the current time and quit |
The format scales with elapsed time so the display stays compact:
| Elapsed | Format | Example |
|---|---|---|
| Under 1 minute | S.mmm |
7.421 |
| Under 1 hour | M:SS.mmm |
3:07.421 |
| 1 hour or more | H:MM:SS.mmm |
1:03:07.421 |
The line refreshes in place at 100 Hz via carriage return.