Bencher is Criterion’s mutable benchmark handle. Pass it to a benchmark helper, then call iter with a closure containing the operation to measure. section 6.5
Measuring an operation
c.bench_function("u8", |b| { b.iter(|| { black_box(3u8 + 4); }); }); The iter closure runs repeatedly while Criterion measures it. Passing the result to black_box prevents the compiler from optimizing away an unused computation. section 6.5
