Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type StopWatchEntry ¶
StopWatchEntry provides method to log measured time entries
type Stopwatch ¶
type Stopwatch struct {
// contains filtered or unexported fields
}
Stopwatch keeps all time measurement results
func NewStopwatch ¶
NewStopwatch creates a new stopwatch object with empty time map
func (*Stopwatch) LogTimeEntryFor ¶ added in v1.0.8
func (st *Stopwatch) LogTimeEntryFor(n interface{}) func()
LogTimeEntryFor sets start time and returns func which logs the time entry, usable as single-line defer call: `defer s.LogTimeEntryFor("xyz")()`
type TimeLog ¶
type TimeLog struct {
// contains filtered or unexported fields
}
TimeLog is a wrapper for the measured data for specific name
func GetTimeLog ¶
GetTimeLog returns a pointer to the TimeLog object related to the provided name (derived from the <n> parameter). If stopwatch is not used, returns nil
func (*TimeLog) LogTimeEntry ¶
LogTimeEntry stores time entry to the TimeLog (the time log itself is stored in the stopwatch sync.Map)