Support us in addition to µs for microsecond durations

This commit is contained in:
Tobie Morgan Hitchcock 2023-02-13 16:06:36 +00:00
parent 5d55f28b98
commit d17b658163

View file

@ -243,6 +243,7 @@ fn duration_raw(i: &str) -> IResult<&str, Duration> {
Duration(match u { Duration(match u {
"ns" => time::Duration::from_nanos(v), "ns" => time::Duration::from_nanos(v),
"µs" => time::Duration::from_micros(v), "µs" => time::Duration::from_micros(v),
"us" => time::Duration::from_micros(v),
"ms" => time::Duration::from_millis(v), "ms" => time::Duration::from_millis(v),
"s" => time::Duration::from_secs(v), "s" => time::Duration::from_secs(v),
"m" => time::Duration::from_secs(v * SECONDS_PER_MINUTE), "m" => time::Duration::from_secs(v * SECONDS_PER_MINUTE),
@ -263,6 +264,7 @@ fn unit(i: &str) -> IResult<&str, &str> {
alt(( alt((
tag("ns"), tag("ns"),
tag("µs"), tag("µs"),
tag("us"),
tag("ms"), tag("ms"),
tag("s"), tag("s"),
tag("m"), tag("m"),