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