Skip to main content

Module progress

Module progress 

Source
Expand description

Progress for a benchmark run, on stderr.

A long comparison — ten minutes of cold installs — is otherwise silent until it finishes. On a terminal this draws one bar that redraws in place. Anywhere else (CI logs) it prints a plain line at most every tenth of the way or every 30 seconds, since a carriage-return animation turns into thousands of lines in a log.

The time remaining is estimated per subject: each subject’s average sample so far, prepare included, times the samples it still has to take. One average over everything would be badly wrong exactly when it matters — when a 20-second cold install shares a run with a 300ms one.

A subject’s one-time setup is shown while it runs but is not a sample: it counts toward elapsed time and nothing else, so a minute-long clone does not make every later sample look a minute long.

Structs§

Bar
The progress reporter. Samples can run for minutes — a cold install, or a prepare step that re-downloads everything — so a ticker thread keeps the output alive between them rather than only when one finishes.

Functions§

fmt
850ms, 42s, 3m05s, 1h02m.