(epochMs: number)
| 26 | |
| 27 | /** Format an epoch-ms timestamp as HH:MM:SS (wall clock). */ |
| 28 | export function formatWallClock(epochMs: number): string { |
| 29 | if (!epochMs || !Number.isFinite(epochMs)) return '--:--:--'; |
| 30 | const d = new Date(epochMs); |
| 31 | const pad = (n: number) => String(n).padStart(2, '0'); |
| 32 | return `${pad(d.getHours())}:${pad(d.getMinutes())}:${pad(d.getSeconds())}`; |
| 33 | } |
| 34 | |
| 35 | /** Format a duration in ms as a compact human string (e.g. "840ms", "2.4s", "1m03s"). */ |
| 36 | export function formatDuration(ms: number | null | undefined): string { |
no test coverage detected