Skip to main content

calibrate

Function calibrate 

Source
pub fn calibrate(reps: u32) -> Result<Calibration, CalError>
Expand description

Derive the ns-per-tick calibration factor.

Cold path: brackets reps counter reads between two reference monotonic-clock reads (repeatable — call again to re-calibrate; see the drift caveat in README). Two independent measurements must agree within 1% or the counter is rejected (CalError::UnstableCounter).

§Errors

CalError::UnsupportedCounter when the architecture has no counter or the invariant/frequency check fails; CalError::UnstableCounter when the two bracketed measurements disagree beyond 1%; CalError::NoProgress when the counter does not advance; CalError::NoReferenceClock when no reference monotonic clock exists.

REQ-CLK-003.