This commit is contained in:
Smaug123
2021-12-01 18:43:50 +00:00
parent f6b1db16ee
commit 159bd312a5
6 changed files with 2107 additions and 0 deletions

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

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