diff --git a/cli/src/main.rs b/cli/src/main.rs index f8c8cc1..55d9ed4 100644 --- a/cli/src/main.rs +++ b/cli/src/main.rs @@ -152,8 +152,7 @@ async fn main() { } timings.drain(..=(warmup as usize)); let avg = (timings.iter().sum::() / n).as_nanos(); - let deviation = (avg - timings.iter().min().unwrap().as_nanos()) - .max(timings.iter().max().unwrap().as_nanos() - avg); + let deviation = (((timings.iter().max().unwrap().as_nanos() - timings.iter().min().unwrap().as_nanos()).pow(2) / 16) as f64).sqrt() as u128; let (avg, avg_units) = if avg >= 1000000000 { (avg as f64 / 1000000000.0, "s")