chrono

chrono was built as a side-product of migrating a backend service from Mocha to Vitest. When starting this migration I wasn’t sure what its impact would be or whether it was worth rolling out to other services1. I wanted some early data to validate my efforts, so I decided to do some benchmarking for some simple statistical analysis.

In cases like this I usually reach for hyperfine, but there were a few things I couldn’t easily measure; for example, the time between running a command and the first test actually starting. After a few days of trying my best to get by with hyperfine, I took this as an excuse to write a personal tool over a few lunchtimes. I probably could’ve found an existing tool to help me here, but there’s something nice about writing personal tooling that works exactly how you want it to.

chrono fills in the gaps left by hyperfine, supporting phrase detection and a TUI stream of stdout and stderr, which is very helpful if you’re monitoring for any problematic behaviour. It also has small optimisations like shell startup calibration so that results are not wrongly influenced by personal setup.

If you’re interested in learning more, take a look at the README or give it a try yourself:

brew install jonlinkens/tap/chrono

Footnotes

  1. Turns out it was 5-10x faster on test runs - I guess we shouldn’t be too surprised given the Mocha setup was over 6 years old.