Day 7 in Rust (#5)

This commit is contained in:
Patrick Stevens
2021-12-07 18:51:36 +00:00
committed by GitHub
parent b965f41711
commit 5ca427390e
8 changed files with 181 additions and 0 deletions

19
day_7/benches/bench.rs Normal file
View File

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