Skip to content

Commit 55b7f61

Browse files
committed
Command line argument to print totals
1 parent 7bd0703 commit 55b7f61

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/main.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ fn main() {
4343
let (part1, part2) = wrapper(data);
4444
let elapsed = instant.elapsed();
4545

46-
solved += 1;
46+
solved += 2;
4747
duration += elapsed;
4848

4949
println!("{BOLD}{YELLOW}{year} Day {day:02}{RESET}");
@@ -57,9 +57,11 @@ fn main() {
5757
}
5858
}
5959

60-
// Print totals
61-
println!("{BOLD}{RED}Solved: {solved}{RESET}");
62-
println!("{BOLD}{GREEN}Duration: {} ms{RESET}", duration.as_millis());
60+
// Optionally print totals
61+
if args().any(|a| a == "--totals") {
62+
println!("{BOLD}{YELLOW}⭐ {solved}{RESET}");
63+
println!("{BOLD}{WHITE}🕓 {} ms{RESET}", duration.as_millis());
64+
}
6365
}
6466

6567
struct Solution {

0 commit comments

Comments
 (0)