Documentation ¶
Overview ¶
Package timer provides a simple wall-clock duration timer based on standard time. Accumulates total and average over multiple Start / Stop intervals.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Time ¶
type Time struct { St time.Time `desc:"the most recent starting time"` Total time.Duration `desc:"the total accumulated time"` N int `desc:"the number of start/stops"` }
Time manages the timer accumulated time and count
func (*Time) Avg ¶
Avg returns the average start / stop interval (assumes each was measuring the same thing).
func (*Time) AvgMSecs ¶ added in v1.1.52
AvgMSecs returns the average start / stop interval as a float64 of milliseconds
func (*Time) AvgSecs ¶
AvgSecs returns the average start / stop interval (assumes each was measuring the same thing) as a float64 of seconds
func (*Time) Reset ¶
func (t *Time) Reset()
Reset resets the overall accumulated Total and N counters and start time to zero
func (*Time) ResetStart ¶ added in v1.1.52
func (t *Time) ResetStart()
ResetStart reset then start the timer
Click to show internal directories.
Click to hide internal directories.