Skip to content

Commit

Permalink
Display milliseconds for elapsed below 1 second.
Browse files Browse the repository at this point in the history
Addresses #597
  • Loading branch information
lgarron committed Oct 6, 2023
1 parent 889084f commit c59f05c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/format.rs
Expand Up @@ -3,7 +3,7 @@ use std::time::Duration;

use number_prefix::NumberPrefix;

const SECOND: Duration = Duration::from_secs(1);
const MILLISECOND: Duration = Duration::from_millis(1);
const MINUTE: Duration = Duration::from_secs(60);
const HOUR: Duration = Duration::from_secs(60 * 60);
const DAY: Duration = Duration::from_secs(24 * 60 * 60);
Expand Down Expand Up @@ -103,7 +103,7 @@ const UNITS: &[(Duration, &str, &str)] = &[
(DAY, "day", "d"),
(HOUR, "hour", "h"),
(MINUTE, "minute", "m"),
(SECOND, "second", "s"),
(MILLISECOND, "millisecond", "ms"),
];

impl fmt::Display for HumanBytes {
Expand Down

0 comments on commit c59f05c

Please sign in to comment.