Making the vencord server happy

Standard deviation is the correct way but shush
This commit is contained in:
Tyler Beckman 2023-12-14 23:48:49 -07:00
parent 07b9da7a08
commit 77f167d992
Signed by: Ty
GPG key ID: 2813440C772555A4

View file

@ -152,8 +152,7 @@ async fn main() {
} }
timings.drain(..=(warmup as usize)); timings.drain(..=(warmup as usize));
let avg = (timings.iter().sum::<Duration>() / n).as_nanos(); let avg = (timings.iter().sum::<Duration>() / n).as_nanos();
let deviation = (avg - timings.iter().min().unwrap().as_nanos()) let deviation = (((timings.iter().max().unwrap().as_nanos() - timings.iter().min().unwrap().as_nanos()).pow(2) / 16) as f64).sqrt() as u128;
.max(timings.iter().max().unwrap().as_nanos() - avg);
let (avg, avg_units) = if avg >= 1000000000 { let (avg, avg_units) = if avg >= 1000000000 {
(avg as f64 / 1000000000.0, "s") (avg as f64 / 1000000000.0, "s")