Struct crude_profiler::Guard [] [src]

pub struct Guard {}

A Guard causes a task to end when it is dropped.

Methods

impl Guard
[src]

Replace the last task pushed (or replaced) with a new one.

Example

let _g = crude_profiler::push("test one");
std::thread::sleep(std::time::Duration::from_secs(2));
_g.replace("test two");
std::thread::sleep(std::time::Duration::from_secs(2));
println!("{}", crude_profiler::report());

Trait Implementations

impl Drop for Guard
[src]

A method called when the value goes out of scope. Read more