format_duration

Function format_duration 

Source
fn format_duration(seconds: u32) -> String
Expand description

A span of seconds at human scale, to at most two units: 45s, 20m, 1h30m, 12d6h.

Two units is the point where more precision stops helping — nobody reading an uptime of 12d6h wanted the seconds. Days matter because this also renders uptimes, where hour counts run into the hundreds.