pub fn calibrate_tsc_state() -> Result<TscState>
Expand description

Calibrate the TSC state.

This function first runs a TSC frequency calibration thread for 100ms, which is pinned to core0. The TSC calibration thread returns both the calibrated frequency, as well as a Vec of TscMoment objects which were validated to be accurate (meaning it’s unlikely an interrupt occurred between moment’s time and tsc values). This function then runs a tsc offset measurement thread for each core, which takes the TSC frequency and the Vec of TscMoments and measures whether or not the TSC values for that core are offset from core 0, and by how much. The frequency and the per-core offsets are returned as a TscState.