Switch to cargo-criterion

This commit is contained in:
Smaug123
2021-12-01 19:06:03 +00:00
parent bb21ddca07
commit 7ad81f84f3
2 changed files with 8 additions and 1 deletions

7
Cargo.lock generated
View File

@@ -178,6 +178,13 @@ dependencies = [
"criterion",
]
[[package]]
name = "day_2"
version = "0.1.0"
dependencies = [
"criterion",
]
[[package]]
name = "either"
version = "1.6.1"

View File

@@ -5,7 +5,7 @@ fn criterion_benchmark(c: &mut Criterion) {
let input = input();
c.bench_function("day 1 part 1", |b| {
b.iter(|| {
part_1(&input);
part_1(&mut input.iter().copied());
})
});
c.bench_function("day 1 part 2", |b| {