rs-basic/members/criterion-demo/benches/my_benchmark.rs
Christoph J. Scherr c5498b5b12
All checks were successful
Cargo Check, Format, Fix and Test / cargo CI (push) Successful in 1m36s
rename criterion-demo and add cucumber-demo
2024-01-12 13:35:37 +01:00

9 lines
302 B
Rust

use criterion::{black_box, criterion_group, criterion_main, Criterion};
use criterion_demo::fibonacci;
pub fn criterion_benchmark(c: &mut Criterion) {
c.bench_function("fib 20", |b| b.iter(|| fibonacci(black_box(20))));
}
criterion_group!(benches, criterion_benchmark);
criterion_main!(benches);