From 3b9eb8f075059c05edf5091181188fc477c5999c Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Sun, 27 Mar 2022 19:10:17 +0200 Subject: [PATCH] Use the proper unit for microseconds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- src/format.rs | 2 +- src/measurement.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/format.rs b/src/format.rs index 984f0f554..53c4a4dbd 100644 --- a/src/format.rs +++ b/src/format.rs @@ -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 { diff --git a/src/measurement.rs b/src/measurement.rs index e253670fc..3e1e24c4b 100644 --- a/src/measurement.rs +++ b/src/measurement.rs @@ -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 {