Module humanize_rs::duration

source ·
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 a duration-type string, (e.g. “1h”, “1h 30m”)