Expand description
This module is used to parse strings to duration.
§Example
use humanize_rs::duration::parse;
use std::time::Duration;
assert_eq!(parse("1h 30m 71s"), Ok(Duration::from_secs(60 * 90 + 71)));
Functions§
- parse
- parse a duration-type string, (e.g. “1h”, “1h 30m”)