NewTimer creates and returns a new Timer object. This is useful when you don't already have a Stat object to associate this Timer with; for example, before the context of a new RPC query is created, a Timer may be needed to measure transport-related operations. Use AppendTimer to append the returne
(tags string)
| 94 | // |
| 95 | // Use AppendTimer to append the returned Timer to a Stat. |
| 96 | func NewTimer(tags string) *Timer { |
| 97 | return &Timer{ |
| 98 | Tags: tags, |
| 99 | Begin: time.Now(), |
| 100 | GoID: goid(), |
| 101 | } |
| 102 | } |
| 103 | |
| 104 | // Egress sets the End field of a timer to the current time. |
| 105 | func (timer *Timer) Egress() { |