StartTimer provides a way to collect a duration metric for a function call in one line. Examples: func foo() { defer t.StartTimer().Finish() // ... } func foo() (err error) { defer t.StartTimer().SuccessFinish(&err) // ... }
(ctx context.Context, ts ...Tags)
| 80 | // // ... |
| 81 | // } |
| 82 | func (t *Timer) StartTimer(ctx context.Context, ts ...Tags) Finisher { |
| 83 | return &timerFinisher{ |
| 84 | timer: t, |
| 85 | startTime: time.Now(), |
| 86 | tags: ts, |
| 87 | ctx: ctx, |
| 88 | } |
| 89 | } |
no outgoing calls