Skip to main content

humanize_duration

Function humanize_duration 

Source
pub fn humanize_duration(secs: u64) -> String
Expand description

Format a duration in seconds as a compact two-part human string: “1h 30m”, “5d 12h”, “45s”, “0s”. Picks the largest unit that fits and adds one smaller unit when it helps readability.