diff --git a/src/main.rs b/src/main.rs index 3574aa2..b2e03dd 100644 --- a/src/main.rs +++ b/src/main.rs @@ -184,11 +184,8 @@ async fn main() { }; let mut timings = Vec::::new(); let large = input_type == InputType::Large; - for _ in 1..warmup { - day.solve(part, large); - } - for i in 1..=n { + for i in 1..=(n+warmup) { let start = Instant::now(); day.solve(part, large); let end = Instant::now(); @@ -197,6 +194,7 @@ async fn main() { print!("\r{:.2}%", (i as f32 / n as f32) * 100.0); let _ = std::io::stdout().flush(); } + 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);