pub enum TimeUnit {
Nanos,
Micros,
Millis,
Seconds,
}Expand description
Time unit for internal tick accounting.
Scaled based on target rate to keep ticks-per-op within u32 range, matching the nosqlbench time-scaling trick.
Variants§
Implementations§
Source§impl TimeUnit
impl TimeUnit
Sourcepub fn nanos_to_ticks(self, nanos: u64) -> u32
pub fn nanos_to_ticks(self, nanos: u64) -> u32
Convert nanoseconds to ticks in this unit.
Sourcepub fn ticks_to_nanos(self, ticks: u32) -> u64
pub fn ticks_to_nanos(self, ticks: u32) -> u64
Convert ticks to nanoseconds.
Sourcepub fn ticks_per_op(self, ops_per_sec: f64) -> u32
pub fn ticks_per_op(self, ops_per_sec: f64) -> u32
Ticks per operation at the given rate.
Trait Implementations§
impl Copy for TimeUnit
impl StructuralPartialEq for TimeUnit
Auto Trait Implementations§
impl Freeze for TimeUnit
impl RefUnwindSafe for TimeUnit
impl Send for TimeUnit
impl Sync for TimeUnit
impl Unpin for TimeUnit
impl UnsafeUnpin for TimeUnit
impl UnwindSafe for TimeUnit
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