Function tiny_bench::bench_with_setup

source ยท
pub fn bench_with_setup<T, R, F: FnMut(R) -> T, S: FnMut() -> R>(
    setup: S,
    closure: F,
)
Expand description

Fitting if some setup for the benchmark is required, and that setup should not be timed. The setup will be run prior to each benchmarking run.

use tiny_bench::{bench_with_configuration_labeled, BenchmarkConfig};
bench_with_configuration_labeled("my_benchmark", &BenchmarkConfig::default(), || {
    // Some code that should be benched
})