Function tiny_bench::bench_with_configuration
source ยท pub fn bench_with_configuration<T, F: FnMut() -> T>(
cfg: &BenchmarkConfig,
closure: F,
)
Expand description
Will run the benchmark with the supplied configuration
use std::time::Duration;
use tiny_bench::{bench_with_configuration, BenchmarkConfig};
bench_with_configuration(&BenchmarkConfig {
measurement_time: Duration::from_secs(10),
..BenchmarkConfig::default()
}, || {
// Some code that should be benched
})