use std::time::Duration; use energy_bench::EnergyBenchBuilder; fn prod(until: u128) -> u128 { (0..until).fold(1, |acc, x| acc.wrapping_mul(x)) } fn main() { let mut bench = EnergyBenchBuilder::new("prod") .with_min_measurement_duration(Duration::from_secs(2)) .with_number_of_measurements(5) .with_idle_duration(0) .build(); const SIZE: u128 = 10000000; bench.benchmark((), &|| SIZE, &prod); }