advent-of-code/aoc2021/aoc2021_bench/benches/aoc2021_bench.rs

17 lines
427 B
Rust
Raw Normal View History

2021-11-25 16:49:52 +01:00
use criterion::{criterion_group, criterion_main, Criterion};
2021-12-01 07:39:21 +01:00
use aoc2021::day01;
2021-12-03 15:36:54 +01:00
use aoc2021::day02;
2021-11-25 16:49:52 +01:00
fn aoc2021_all(c: &mut Criterion) {
2021-12-01 07:39:21 +01:00
c.bench_function("day01", |b| b.iter(|| day01::run().unwrap()));
2021-12-03 15:36:54 +01:00
c.bench_function("day02", |b| b.iter(|| day02::run().unwrap()));
2021-11-25 16:49:52 +01:00
}
criterion_group! {
name = all_days;
config = Criterion::default().sample_size(200);
targets = aoc2021_all
}
criterion_main!(all_days);