Struct Perf

Source
pub struct Perf { /* private fields */ }
Expand description

This is what you get returned from the macro. You probably won’t create this directly.

Implementations§

Source§

impl Perf

Source

pub fn new(ident: String, start_line: String) -> Self

Source

pub fn lap(&mut self, msg: &str)

Gives the time elapsed from the last lap (or from the starting point of there has been no previous laps). You can have as many laps as you want. The message is printed with the measurement to identify where the measurement was done.

Source

pub fn split(&self, msg: &str)

Prints the time from the starting point where the method is called. In contrast to #lap() this always shows the time elapsed from the start.

Source

pub fn end(self)

Shows the end time and consumes self so the timer can not be used any further.

Auto Trait Implementations§

§

impl Freeze for Perf

§

impl RefUnwindSafe for Perf

§

impl Send for Perf

§

impl Sync for Perf

§

impl Unpin for Perf

§

impl UnwindSafe for Perf

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.