pub const fn duration_from_frame_tc_cpu_hz(
    frame_ts_count: u32,
    cpu_hz: u32
) -> Duration
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)
    }