Skip to content

Commit be61ad8

Browse files
committed
Remove inaccurate timing info
1 parent 70dac10 commit be61ad8

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/main.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,31 +33,29 @@ fn main() {
3333
.filter(|solution| year.is_none_or(|y: u32| y == solution.year))
3434
.filter(|solution| day.is_none_or(|d: u32| d == solution.day));
3535

36-
// Pretty print output and timing for each solution
36+
// Pretty print output for each solution.
3737
let mut solved = 0;
3838
let mut duration = Duration::ZERO;
3939

4040
for Solution { year, day, path, wrapper } in solutions {
4141
if let Ok(data) = read_to_string(&path) {
4242
let instant = Instant::now();
4343
let (part1, part2) = wrapper(data);
44-
let elapsed = instant.elapsed();
4544

4645
solved += 2;
47-
duration += elapsed;
46+
duration += instant.elapsed();
4847

4948
println!("{BOLD}{YELLOW}{year} Day {day:02}{RESET}");
5049
println!(" Part 1: {part1}");
5150
println!(" Part 2: {part2}");
52-
println!(" Elapsed: {} μs", elapsed.as_micros());
5351
} else {
5452
eprintln!("{BOLD}{RED}{year} Day {day:02}{RESET}");
5553
eprintln!(" Missing input!");
5654
eprintln!(" Place input file in {BOLD}{WHITE}{}{RESET}", path.display());
5755
}
5856
}
5957

60-
// Optionally print totals
58+
// Optionally print totals.
6159
if args().any(|a| a == "--totals") {
6260
println!("{BOLD}{YELLOW}⭐ {solved}{RESET}");
6361
println!("{BOLD}{WHITE}🕓 {} ms{RESET}", duration.as_millis());

0 commit comments

Comments
 (0)