github.com/zeebo/mon@v0.0.0-20211012163247-13d39bdb54fa/time_off.go (about) 1 // +build nomon 2 3 package mon 4 5 // Times calls the callback with all of the histograms that have been captured. 6 func Times(func(string, *State) bool) {} 7 8 // Thunk is a type that allows one to get the benefits of Time without having to 9 // compute the caller every time it's called. Zero values are valid. 10 type Thunk struct{} 11 12 // Time returns a Timer where the name is chosen the first time by the caller. Don't 13 // use the same Thunk from different functions/methods. 14 func (t *Thunk) Start() Timer { return Timer{} } 15 16 // Time returns a Timer using the calling function for the name. 17 func Start() Timer { return Timer{} } 18 19 // TimeNamed returns a Timer that records a duration when its Done method is called. 20 func StartNamed(name string) Timer { return Timer{} } 21 22 // Timer keeps track of the state necessary to record timing info. 23 type Timer struct{} 24 25 // Stop records the timing info. 26 func (Timer) Stop(*error) {}