Function spectrusty_core::chip::duration_from_frame_tc_cpu_hz
source · Expand description
Returns a duration from the number of T-states in a single frame and a CPU clock rate.
Examples found in repository?
src/chip.rs (line 187)
185 186 187 188 189 190 191 192 193 194 195 196 197 198
fn effective_frame_duration(multiplier: f64) -> Duration {
let cpu_rate = Self::effective_cpu_rate(multiplier).round() as u32;
duration_from_frame_tc_cpu_hz(Self::FRAME_TSTATES as u32, cpu_rate)
}
/// Returns the duration of a single execution frame in nanoseconds.
#[inline]
fn frame_duration_nanos() -> u32 {
nanos_from_frame_tc_cpu_hz(Self::FRAME_TSTATES as u32, Self::CPU_HZ) as u32
}
/// Returns the duration of a single execution frame.
#[inline]
fn frame_duration() -> Duration {
duration_from_frame_tc_cpu_hz(Self::FRAME_TSTATES as u32, Self::CPU_HZ)
}