pub struct CPUInfo;
Expand description
CPU information structure. Provides frequency and TSC-to-cycle scaling information.
Implementations§
Source§impl CPUInfo
impl CPUInfo
Sourcepub fn get_frequency_hz() -> FreqInfo
pub fn get_frequency_hz() -> FreqInfo
Get current core frequency. Runs known latency loop and time it. This information allows to calculate core frequency. Current method might not work correctly when something running on second thread (SMT).
Sourcepub fn get_frequency_ghz() -> FreqInfo
pub fn get_frequency_ghz() -> FreqInfo
Get core frequency in GHz.
Uses CPUInfo::get_frequency_hz
method.
Sourcepub fn get_time_stamp() -> u64
pub fn get_time_stamp() -> u64
Get current CPU time stamp counter value
Uses RDTSC
instruction on x86
architectures
Auto Trait Implementations§
impl Freeze for CPUInfo
impl RefUnwindSafe for CPUInfo
impl Send for CPUInfo
impl Sync for CPUInfo
impl Unpin for CPUInfo
impl UnwindSafe for CPUInfo
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more