pub fn is_tsc_scaling_required(&self, state_tsc_freq: u32) -> Result<bool> {
        // Compare the current TSC freq to the one found
        // in the state. If they are different, we need to
        // scale the TSC to the freq found in the state.
        // We accept values within a tolerance of 250 parts
        // per million beacuse it is common for TSC frequency
        // to differ due to calibration at boot time.
        let diff = (self.get_tsc_khz()? as i64 - state_tsc_freq as i64).abs();
        Ok(diff > (state_tsc_freq as f64 * TSC_KHZ_TOL).round() as i64)
    }
// Checks whether the TSC needs scaling when restoring a snapshot.
Checks whether the TSC needs scaling when restoring a snapshot.
Checks whether the TSC needs scaling when restoring a snapshot .
pub fn is_tsc_scaling_required(&self, state_tsc_freq: u32) -> Result<bool> {
        // Compare the current TSC freq to the one found
        // in the state. If they are different, we need to
        // scale the TSC to the freq found in the state.
        // We accept values within a tolerance of 250 parts
        // per million beacuse it is common for TSC frequency
        // to differ due to calibration at boot time.
        let diff = (self.get_tsc_khz()? as i64 - state_tsc_freq as i64).abs();
        Ok(diff > (state_tsc_freq as f64 * TSC_KHZ_TOL).round() as i64)
    }
pub fn is_tsc_scaling_required ( & self , state_tsc_freq : u32 ) -> Result < bool > { // Compare the current TSC freq to the one found // in the state. If they are different, we need to // scale the TSC to the freq found in the state. // We accept values within a tolerance of 250 parts // per million beacuse it is common for TSC frequency // to differ due to calibration at boot time. let diff = ( self . get_tsc_khz ( ) ? as i64 - state_tsc_freq as i64 ) . abs ( ) ; Ok ( diff > ( state_tsc_freq as f64 * TSC_KHZ_TOL ) . round ( ) as i64 ) }
Checks whether the TSC needs scaling when restoring a snapshot.
Checks whether the TSC needs scaling when restoring a snapshot .
&self
state_tsc_freq
u32
&self
state_tsc_freq
u32