mirror of
https://github.com/Smaug123/advent-of-code-2021
synced 2025-10-18 10:18:38 +00:00
Day 1
This commit is contained in:
19
day_1/benches/day_1.rs
Normal file
19
day_1/benches/day_1.rs
Normal 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);
|
Reference in New Issue
Block a user