Documentation ¶
Index ¶
- func Time(f func()) time.Duration
- type Timer
- type Timing
- func (t *Timing) Delete(name string)
- func (t *Timing) Do(f func(string, *Timer))
- func (t *Timing) Interval(name string) time.Duration
- func (t *Timing) Reset(name string)
- func (t *Timing) ResetAll()
- func (t *Timing) Running(name string) bool
- func (t *Timing) Start(name string)
- func (t *Timing) Stop(name string) time.Duration
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Timer ¶
type Timer struct {
// contains filtered or unexported fields
}
Timer measures time intervals.
func (*Timer) Interval ¶
Interval returns the elapsed time interval. Calling Interval on a Timer that has never run will always return zero. Calling Interval on a running timer will return the interval from the start time to now. Calling Interval on a stopped timer will always return the interval of the last run.
func (*Timer) Reset ¶
func (t *Timer) Reset()
Reset will clear the timer if it is not running. Calling Reset on a running timer does nothing.
type Timing ¶
type Timing struct {
// contains filtered or unexported fields
}
func (*Timing) Interval ¶
Interval returns the elapsed time interval for the named timer. The result is zero if the named timer doesn't exist. Calling Interval on a running timer will return the interval from the start time to now. Calling Interval on a stopped timer will always return the interval of the last run.
func (*Timing) Reset ¶
Reset will clear the named timer if it is not running. Calling Reset on a running timer does nothing.
func (*Timing) Running ¶
Running returns true if the name timer is currently running. The result is false if the named timer doesn't exit.