Struct aleo_std_timer::Timer[][src]

pub struct Timer<'name> { /* fields omitted */ }
Expand description

When this struct is dropped, it logs a message stating its name and how long the execution time was. Can be used to time functions or other critical areas.

Implementations

Constructs a new Timer that prints a ‘Start’ and a ‘Finish’ message. This method is not usually called directly, use the timer! macro instead.

Returns how long the timer has been running for.

Outputs a log message with a target of ‘Lap’ showing the current elapsed time, but does not stop the timer. This method can be called multiple times. The message can include further information via a format_args! approach. This method is usually not called directly, it is easier to use the lap! macro.

Outputs a log message with a target of ‘Finish’ and suppresses the normal message that is output when the timer is dropped. The message can include further format_args! information. This method is normally called using the finish! macro. Calling finish() again will have no effect.

Trait Implementations

Drops the timer, outputting a log message with a target of Finish if the finish method has not yet been called.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.