Skip to main content

format_duration

Function format_duration 

Source
pub fn format_duration(seconds: Option<f64>) -> String
Expand description

Format a duration in seconds as 45s, 3m 20s or 1h 04m.

Returns UNKNOWN for None and for values that are negative or not finite. Sub-second values round up to 1s so a live countdown never displays 0s while work is still in flight.