Record records an event and assigns it the given name.
(name string)
| 894 | |
| 895 | // Record records an event and assigns it the given name. |
| 896 | func (t *Timer) Record(name string) { |
| 897 | now := time.Now() |
| 898 | t.records = append(t.records, record{ |
| 899 | Name: name, |
| 900 | Dur: now.Sub(t.last).Round(time.Millisecond), |
| 901 | }) |
| 902 | t.last = now |
| 903 | } |
| 904 | |
| 905 | // Total returns the duration since the timer was started. |
| 906 | func (t *Timer) Total() time.Duration { |
no outgoing calls
no test coverage detected