Changes as per code review
esenac
6 years ago
28 | 28 |
t.h.Observe(d)
|
29 | 29 |
}
|
30 | 30 |
|
31 | |
// Unit sets the timer time unit
|
|
31 |
// Unit sets the unit of the float64 emitted by the timer.
|
|
32 |
// By default, the timer emits seconds.
|
32 | 33 |
func (t *Timer) Unit(u time.Duration) {
|
33 | 34 |
t.u = u
|
34 | 35 |
}
|
32 | 32 |
}
|
33 | 33 |
|
34 | 34 |
func TestTimerUnit(t *testing.T) {
|
35 | |
|
36 | 35 |
for _, tc := range []struct {
|
37 | 36 |
name string
|
38 | 37 |
unit time.Duration
|