advent-of-code/aoc2020/benches/bench.rs

19 lines
515 B
Rust
Raw Normal View History

2020-12-01 16:34:25 +01:00
use criterion::{criterion_group, criterion_main, Criterion};
use aoc2020::day01;
2020-12-02 12:50:50 +01:00
use aoc2020::day02;
2020-12-03 17:17:44 +01:00
use aoc2020::day03;
2020-12-01 16:34:25 +01:00
fn aoc2020_all(c: &mut Criterion) {
c.bench_function("day01", |b| b.iter(|| day01::run().unwrap()));
2020-12-02 12:50:50 +01:00
c.bench_function("day02", |b| b.iter(|| day02::run().unwrap()));
2020-12-03 17:17:44 +01:00
c.bench_function("day03", |b| b.iter(|| day03::run().unwrap()));
2020-12-01 16:34:25 +01:00
}
criterion_group! {
name = all_days;
config = Criterion::default().sample_size(30);
targets = aoc2020_all
}
criterion_main!(all_days);