use std::time::{Duration, Instant}; use color_eyre::Result; mod day_01; mod day_02; mod day_03; mod day_04; mod day_05; fn main() -> Result<()> { color_eyre::install()?; println!("Advent of Code 2021\n"); let mut runtimes = vec![]; let days: Vec Result<()>> = vec![ day_01::solve, day_02::solve, day_03::solve, day_04::solve, day_05::solve, ]; for day in days { let start = Instant::now(); day()?; let runtime = Instant::now() - start; runtimes.push(runtime); println!("- Runtime: {:#?}\n", runtime); } println!( "Total runtime: {:#?}", runtimes.into_iter().sum::() ); Ok(()) }