Struct slog_perf::TimeReporter [] [src]

pub struct TimeReporter { /* fields omitted */ }

Collect and report total time spent on set of activities

TimeReporter is useful for generating and reporting time reports: how much time was spend on a given activity.

On drop or on call to finish it will report total times gathered to slog::Logger.

Methods

impl TimeReporter
[src]

Create new TimeReporter

Start counting time for a state named "key"

If this the TimeReporter was already counting time for another state, it will end counting time for it before starting new one.

Start counting time and execute a function f

This is handy syntax for if let or while let expressions where it would be inconvenient to add standalone start call.

Finish counting time and report results

Trait Implementations

impl Drop for TimeReporter
[src]

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