pub struct HighPerformanceClock { /* private fields */ }Expand description
高性能时钟管理器
使用单调时钟 + 基准时间戳,避免频繁的系统调用
Implementations§
Source§impl HighPerformanceClock
impl HighPerformanceClock
Sourcepub fn new_with_calibration_interval(calibration_interval_secs: u64) -> Self
pub fn new_with_calibration_interval(calibration_interval_secs: u64) -> Self
Sourcepub fn now_micros(&self) -> i64
pub fn now_micros(&self) -> i64
Sourcepub fn now_micros_with_calibration(&mut self) -> i64
pub fn now_micros_with_calibration(&mut self) -> i64
Sourcepub fn elapsed_micros_since(&self, start_timestamp_us: i64) -> i64
pub fn elapsed_micros_since(&self, start_timestamp_us: i64) -> i64
Trait Implementations§
Source§impl Debug for HighPerformanceClock
impl Debug for HighPerformanceClock
Auto Trait Implementations§
impl Freeze for HighPerformanceClock
impl RefUnwindSafe for HighPerformanceClock
impl Send for HighPerformanceClock
impl Sync for HighPerformanceClock
impl Unpin for HighPerformanceClock
impl UnwindSafe for HighPerformanceClock
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request