From e867d7c35e1ffea145edde4b74b2ba2ad6a7a12e Mon Sep 17 00:00:00 2001 From: The 8472 Date: Sun, 5 May 2024 22:54:11 +0200 Subject: [PATCH] emit fractional benchmark nanoseconds in libtest's JSON output format --- library/test/src/formatters/json.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/test/src/formatters/json.rs b/library/test/src/formatters/json.rs index 47c4e7757e4..6245aae17c4 100644 --- a/library/test/src/formatters/json.rs +++ b/library/test/src/formatters/json.rs @@ -167,8 +167,8 @@ fn write_result( ), TestResult::TrBench(ref bs) => { - let median = bs.ns_iter_summ.median as usize; - let deviation = (bs.ns_iter_summ.max - bs.ns_iter_summ.min) as usize; + let median = bs.ns_iter_summ.median; + let deviation = bs.ns_iter_summ.max - bs.ns_iter_summ.min; let mbps = if bs.mb_s == 0 { String::new()