ariel_os::bench

Function benchmark

pub fn benchmark<F>(iterations: usize, f: F) -> Result<usize, Error>
where F: FnMut(),
Available on crate feature bench only.
Expand description

Benchmarks “time” required to run the provided function.

Runs the provided function iterations times, and returns the mean number of system timer increments per iteration.

§Errors

Returns Error::SystemTimerWrapped if the system timer counter has wrapped when benchmarking.