Skip to main content

timer_resolution_ns

Function timer_resolution_ns 

Source
pub fn timer_resolution_ns() -> f64
Expand description

Returns the timer resolution in nanoseconds.

This is the theoretical minimum delay that can be measured, calculated as 1e9 / frequency.

§Returns

  • Resolution in nanoseconds (e.g., 0.33 for 3GHz TSC, 42 for 24MHz Apple Silicon)
  • f64::INFINITY for fallback platforms without cycle counters

§Examples

let resolution = tacet_core::timer::timer_resolution_ns();
println!("Timer resolution: {:.2} ns", resolution);