Record the duration of the execution of the given function.
(f func())
| 220 | |
| 221 | // Record the duration of the execution of the given function. |
| 222 | func (t *StandardTimer) Time(f func()) { |
| 223 | ts := time.Now() |
| 224 | f() |
| 225 | t.Update(time.Since(ts)) |
| 226 | } |
| 227 | |
| 228 | // Record the duration of an event, in nanoseconds. |
| 229 | func (t *StandardTimer) Update(d time.Duration) { |