Write a run's elapsed time once, in the duration formatter's units

The runs table drew when a run started and how long it took in two
notations ('56m ago | 55.5 min'), and for a run still going those are the
same reading twice. `dur` now steps past the minute into hours and days,
the ago reading is derived from it, and a running run writes only the
elapsed one.
This commit is contained in:
2026-08-28 11:02:59 +02:00
parent f3b4c8a1b3
commit ffaf66c14e
3 changed files with 26 additions and 8 deletions
+2
View File
@@ -38,6 +38,8 @@ assert.equal(dur(0), "0 ms")
assert.equal(dur(203.63), "204 ms")
assert.equal(dur(1240), "1.24 s")
assert.equal(dur(90_000), "1.5 min")
assert.equal(dur(12_600_000), "3.5 h")
assert.equal(dur(259_200_000), "3 d")
// The plain window down to 0.01 ms, so a fast run keeps one unit across polls.
assert.equal(dur(0.4), "0.4 ms")