Skip to content

Commit 5373b55

Browse files
committed
feat: print solve time (part1 + part2)
1 parent b1622db commit 5373b55

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

aoc_derive/src/lib.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@ pub fn aoc_main(_args: TokenStream, item: TokenStream) -> TokenStream {
1414

1515
fn main() {
1616
let input_file = std::env::args().nth(1).expect("Expect input file as first argument");
17+
let start_time = std::time::Instant::now();
1718
let solution: Solution = #solve_fn_identifier(Input::new(&input_file)).into();
1819
println!("{}", solution);
20+
println!("Time: {:.1?}", start_time.elapsed());
1921
solution.copy_to_clipboard();
2022
}
2123
}
@@ -112,10 +114,7 @@ pub fn hash_map_from_str(item: TokenStream) -> TokenStream {
112114
})
113115
.unwrap_or(":".to_string());
114116

115-
let reverse = s
116-
.attrs
117-
.iter()
118-
.any(|attr| attr.meta.path().is_ident("reverse"));
117+
let reverse = s.attrs.iter().any(|attr| attr.meta.path().is_ident("reverse"));
119118
let reverse = if reverse {
120119
quote! { true }
121120
} else {

0 commit comments

Comments
 (0)