Crate compound_duration

Crate compound_duration 

Source
Expand description

Convert seconds to compound duration (week, days, hours, minutes, seconds)

This library provides simple, lightweight functions to format time durations into human-readable compound format strings.

§Examples

use compound_duration::{format_dhms, format_wdhms};

assert_eq!(format_dhms(7259), "2h59s");
assert_eq!(format_wdhms(6_000_000), "9w6d10h40m");

Constants§

DAY
HOUR
MINUTE
MS
NANOS
NS
SECOND
US
WEEK

Functions§

format_dhms
Convert seconds to compound duration (days, hours, minutes, seconds)
format_ns
Convert nanoseconds to compound duration (days, hours, minutes, seconds, ms, µs, ns)
format_wdhms
Convert seconds to compound duration (week, days, hours, minutes, seconds)