Skip to content

Commit

Permalink
Use the proper unit for microseconds (#567)
Browse files Browse the repository at this point in the history
Using "us" instead of "µs" is ok in ASCII-only environments, but the
vast majority of environments where criterion is going to be used
properly support Unicode.
  • Loading branch information
linkmauve committed Jul 2, 2022
1 parent ff2ec14 commit 1c8873b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/format.rs
Expand Up @@ -12,7 +12,7 @@ pub fn time(ns: f64) -> String {
} else if ns < 10f64.powi(3) {
format!("{:>6} ns", short(ns))
} else if ns < 10f64.powi(6) {
format!("{:>6} us", short(ns / 1e3))
format!("{:>6} µs", short(ns / 1e3))
} else if ns < 10f64.powi(9) {
format!("{:>6} ms", short(ns / 1e6))
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/measurement.rs
Expand Up @@ -164,7 +164,7 @@ impl ValueFormatter for DurationFormatter {
} else if ns < 10f64.powi(3) {
(10f64.powi(0), "ns")
} else if ns < 10f64.powi(6) {
(10f64.powi(-3), "us")
(10f64.powi(-3), "µs")
} else if ns < 10f64.powi(9) {
(10f64.powi(-6), "ms")
} else {
Expand Down

0 comments on commit 1c8873b

Please sign in to comment.