pub struct Cycles { /* private fields */ }Expand description
Represent the number of cpu cycles
Implementations§
Source§impl Cycles
impl Cycles
Sourcepub const fn from_hz(h: c_ll) -> Self
pub const fn from_hz(h: c_ll) -> Self
use cpu_cycles_reader::Cycles;
assert_eq!(Cycles::new(1000), Cycles::from_hz(1000));Sourcepub const fn from_khz(k: c_ll) -> Self
pub const fn from_khz(k: c_ll) -> Self
use cpu_cycles_reader::Cycles;
assert_eq!(Cycles::new(1000), Cycles::from_khz(1));Sourcepub const fn from_mhz(m: c_ll) -> Self
pub const fn from_mhz(m: c_ll) -> Self
use cpu_cycles_reader::Cycles;
assert_eq!(Cycles::new(2_000_000), Cycles::from_mhz(2));Sourcepub const fn from_ghz(g: c_ll) -> Self
pub const fn from_ghz(g: c_ll) -> Self
use cpu_cycles_reader::Cycles;
assert_eq!(Cycles::new(3_000_000_000), Cycles::from_ghz(3));Sourcepub const fn as_hz(&self) -> c_ll
pub const fn as_hz(&self) -> c_ll
use cpu_cycles_reader::Cycles;
assert_eq!(Cycles::new(1000).as_hz(), 1000);Sourcepub const fn as_khz(&self) -> c_ll
pub const fn as_khz(&self) -> c_ll
use cpu_cycles_reader::Cycles;
assert_eq!(Cycles::new(1_000_000).as_khz(), 1000);Trait Implementations§
Source§impl AddAssign for Cycles
impl AddAssign for Cycles
Source§fn add_assign(&mut self, rhs: Cycles)
fn add_assign(&mut self, rhs: Cycles)
Performs the
+= operation. Read moreSource§impl<__RhsT> DivAssign<__RhsT> for Cycleswhere
c_longlong: DivAssign<__RhsT>,
impl<__RhsT> DivAssign<__RhsT> for Cycleswhere
c_longlong: DivAssign<__RhsT>,
Source§fn div_assign(&mut self, rhs: __RhsT)
fn div_assign(&mut self, rhs: __RhsT)
Performs the
/= operation. Read moreSource§impl From<Cycles> for c_longlong
impl From<Cycles> for c_longlong
Source§impl<__RhsT> MulAssign<__RhsT> for Cycleswhere
c_longlong: MulAssign<__RhsT>,
impl<__RhsT> MulAssign<__RhsT> for Cycleswhere
c_longlong: MulAssign<__RhsT>,
Source§fn mul_assign(&mut self, rhs: __RhsT)
fn mul_assign(&mut self, rhs: __RhsT)
Performs the
*= operation. Read moreSource§impl Ord for Cycles
impl Ord for Cycles
Source§impl PartialOrd for Cycles
impl PartialOrd for Cycles
Source§impl<__RhsT> RemAssign<__RhsT> for Cycleswhere
c_longlong: RemAssign<__RhsT>,
impl<__RhsT> RemAssign<__RhsT> for Cycleswhere
c_longlong: RemAssign<__RhsT>,
Source§fn rem_assign(&mut self, rhs: __RhsT)
fn rem_assign(&mut self, rhs: __RhsT)
Performs the
%= operation. Read moreSource§impl SubAssign for Cycles
impl SubAssign for Cycles
Source§fn sub_assign(&mut self, rhs: Cycles)
fn sub_assign(&mut self, rhs: Cycles)
Performs the
-= operation. Read moreimpl Copy for Cycles
impl Eq for Cycles
impl StructuralPartialEq for Cycles
Auto Trait Implementations§
impl Freeze for Cycles
impl RefUnwindSafe for Cycles
impl Send for Cycles
impl Sync for Cycles
impl Unpin for Cycles
impl UnwindSafe for Cycles
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