pub trait CycleCounter {
// Required methods
fn start(&self);
fn stop(&self);
fn count(&self) -> u64;
fn reset(&self);
// Provided method
fn profile_closure<F: FnOnce()>(&self, f: F) -> u64 { ... }
}
Required Methods§
Provided Methods§
Sourcefn profile_closure<F: FnOnce()>(&self, f: F) -> u64
fn profile_closure<F: FnOnce()>(&self, f: F) -> u64
Benchmark the number of cycles to run a passed closure. This function is intended for use debugging in-kernel routines.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.