Day 3 in Rust

This commit is contained in:
Smaug123
2021-12-03 18:48:44 +00:00
parent 8329dc9c40
commit 7551e5e3b3
7 changed files with 1245 additions and 0 deletions

19
day_3/benches/day_3.rs Normal file
View File

@@ -0,0 +1,19 @@
use criterion::{black_box, criterion_group, criterion_main, Criterion};
use day_3::day_3::{input, part_1, part_2};
fn criterion_benchmark(c: &mut Criterion) {
let input = input::<12>();
c.bench_function("day 3 part 1", |b| {
b.iter(|| {
black_box(part_1(&input));
})
});
c.bench_function("day 3 part 2", |b| {
b.iter(|| {
black_box(part_2(&input));
})
});
}
criterion_group!(benches, criterion_benchmark);
criterion_main!(benches);