Struct specifications::profiling::Timing
source · pub struct Timing { /* private fields */ }
Expand description
Defines a taken Timing, which represents an amount of time that has passed.
Implementations§
source§impl Timing
impl Timing
sourcepub const fn none() -> Self
pub const fn none() -> Self
Returns a Timing in which no time has passed.
§Returns
A new Timing instance, for which all Timing::elapsed_XX()
functions will return 0.
sourcepub fn display(&self) -> TimingFormatter<'_>
pub fn display(&self) -> TimingFormatter<'_>
Writes a human-readable representation of the elapsed time in this Timing.
Will attempt to find the correct scale automagically; specifically, will try to write as seconds unless the time is less than that. Then, it will move to milliseconds, all the way up to nanoseconds.
§Returns
A TimingFormatter that implements Display to do this kind of formatting on this Timing.
sourcepub const fn elapsed_s(&self) -> u128
pub const fn elapsed_s(&self) -> u128
Returns the time that has been elapsed, in seconds.
§Returns
The elapsed time that this Timing represents in seconds.
sourcepub const fn elapsed_ms(&self) -> u128
pub const fn elapsed_ms(&self) -> u128
Returns the time that has been elapsed, in milliseconds.
§Returns
The elapsed time that this Timing represents in milliseconds.
sourcepub const fn elapsed_us(&self) -> u128
pub const fn elapsed_us(&self) -> u128
Returns the time that has been elapsed, in microseconds.
§Returns
The elapsed time that this Timing represents in microseconds.
sourcepub const fn elapsed_ns(&self) -> u128
pub const fn elapsed_ns(&self) -> u128
Returns the time that has been elapsed, in nanoseconds.
§Returns
The elapsed time that this Timing represents in nanoseconds.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Timing
impl<'de> Deserialize<'de> for Timing
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Copy for Timing
Auto Trait Implementations§
impl Freeze for Timing
impl RefUnwindSafe for Timing
impl Send for Timing
impl Sync for Timing
impl Unpin for Timing
impl UnwindSafe for Timing
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request