pub fn format_compact_session_elapsed(secs: f64) -> StringExpand description
Compact 8-char session-elapsed clock with a unit suffix
(s/m/h) that scales as the run gets longer. The
fractional precision shrinks step-by-step so the integer
part stays bounded and the total width is constant — log
rows column-align cleanly even when the suffix changes
underneath them.
Layout (always 8 visible chars):
| Magnitude | Example | Shape |
|---|---|---|
| 0 – 9.99999s | 1.23456s | 1 int + 5 frac + s |
| 10 – 99.9999s | 99.1234s | 2 int + 4 frac + s |
| 100 – 999.999s | 999.123s | 3 int + 3 frac + s |
| 16m – 1h | 1.23456m | 1 int + 5 frac + m |
| 10m – 100m | 99.1234m | 2 int + 4 frac + m |
| 100m – 1000m | 999.123m | 3 int + 3 frac + m |
| 1h+ | 1.23456h | hours scaled |
| 10h+ | 99.1234h | |
| 100h+ | 999.123h |
Beyond 999.999h (≈ 41 days) the column widens, matching
the format_elapsed_seconds precedent for runs longer
than fit in 7 chars: the integer part grows, the
fractional precision stays at 3.