Function tiny_bench::bench_with_setup_configuration
source ยท pub fn bench_with_setup_configuration<T, R, F: FnMut(R) -> T, S: FnMut() -> R>(
cfg: &BenchmarkConfig,
setup: S,
closure: F,
)
Expand description
Run bench with setup and configuration
use std::time::Duration;
use tiny_bench::{bench_with_setup_configuration, BenchmarkConfig};
bench_with_setup_configuration(&BenchmarkConfig::default(), || std::thread::sleep(Duration::from_micros(5)), |_| {
// Some code that should be benched
})