pub trait HostConfig {
    const CPU_HZ: u32;
    const FRAME_TSTATES: FTs;

    fn effective_cpu_rate(multiplier: f64) -> f64 { ... }
    fn effective_frame_duration_nanos(multiplier: f64) -> u32 { ... }
    fn effective_frame_duration(multiplier: f64) -> Duration { ... }
    fn frame_duration_nanos() -> u32 { ... }
    fn frame_duration() -> Duration { ... }
}
Expand description

A helper trait for accessing parameters of well-known host configurations.

Required Associated Constants§

The number of CPU cycles (T-states) per second.

The number of CPU cycles (T-states) in a single execution frame.

Provided Methods§

Returns the CPU rate (T-states / second) after multiplying it by the multiplier.

Examples found in repository?
src/chip.rs (line 179)
178
179
180
181
182
183
184
185
186
187
188
    fn effective_frame_duration_nanos(multiplier: f64) -> u32 {
        let cpu_rate = Self::effective_cpu_rate(multiplier).round() as u32;
        nanos_from_frame_tc_cpu_hz(Self::FRAME_TSTATES as u32, cpu_rate) as u32
    }
    /// Returns the duration of a single execution frame after multiplying the CPU rate by
    /// the `multiplier`.
    #[inline]
    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 after multiplying the CPU rate by the multiplier.

Returns the duration of a single execution frame after multiplying the CPU rate by the multiplier.

Returns the duration of a single execution frame in nanoseconds.

Returns the duration of a single execution frame.

Implementors§