mirror of
https://github.com/bertptrs/adventofcode.git
synced 2025-12-25 12:50:32 +01:00
Implement day 25
This commit is contained in:
@@ -7,7 +7,7 @@ use criterion::criterion_main;
|
||||
use criterion::BenchmarkId;
|
||||
use criterion::Criterion;
|
||||
|
||||
const DAYS_IMPLEMENTED: usize = 22;
|
||||
const DAYS_IMPLEMENTED: usize = 25;
|
||||
|
||||
fn read_input(day: usize) -> Vec<u8> {
|
||||
let input_path = format!("inputs/{:02}.txt", day);
|
||||
@@ -26,15 +26,18 @@ pub fn benchmark_days(c: &mut Criterion) {
|
||||
let input = read_input(day);
|
||||
|
||||
let part1 = get_implementation(day, false);
|
||||
let part2 = get_implementation(day, true);
|
||||
|
||||
c.bench_with_input(BenchmarkId::new("part1", day), &input, |b, i| {
|
||||
b.iter(|| part1(&mut &i[..]));
|
||||
});
|
||||
|
||||
c.bench_with_input(BenchmarkId::new("part2", day), &input, |b, i| {
|
||||
b.iter(|| part2(&mut &i[..]));
|
||||
});
|
||||
if day < 25 {
|
||||
let part2 = get_implementation(day, true);
|
||||
|
||||
c.bench_with_input(BenchmarkId::new("part2", day), &input, |b, i| {
|
||||
b.iter(|| part2(&mut &i[..]));
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user