[][src]Struct gloo_console_timer::ConsoleTimer

pub struct ConsoleTimer<'a> { /* fields omitted */ }

A console time measurement.

See ConsoleTimer::scope for starting a labeled time measurement of code wrapped in a closure.

Methods

impl<'a> ConsoleTimer<'a>[src]

pub fn new(label: &'a str) -> ConsoleTimer<'a>[src]

Starts a console time measurement. The measurement ends when the constructed ConsoleTimer object is dropped.

Example

use gloo_console_timer::ConsoleTimer;

let _timer = ConsoleTimer::new("foo");

pub fn scope<F, T>(label: &str, f: F) -> T where
    F: FnOnce() -> T, 
[src]

Starts a scoped console time measurement

Example

use gloo_console_timer::ConsoleTimer;

let value = ConsoleTimer::scope("foo", || {
    // Code to measure here
});

Trait Implementations

impl<'a> Drop for ConsoleTimer<'a>[src]

impl<'a> Debug for ConsoleTimer<'a>[src]

Auto Trait Implementations

impl<'a> Send for ConsoleTimer<'a>

impl<'a> Unpin for ConsoleTimer<'a>

impl<'a> Sync for ConsoleTimer<'a>

impl<'a> UnwindSafe for ConsoleTimer<'a>

impl<'a> RefUnwindSafe for ConsoleTimer<'a>

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]