diff options
author | Michael Stapelberg <stapelberg@debian.org> | 2014-06-19 09:22:53 +0200 |
---|---|---|
committer | Michael Stapelberg <stapelberg@debian.org> | 2014-06-19 09:22:53 +0200 |
commit | 8a39ee361feb9bf46d728ff1ba4f07ca1d9610b1 (patch) | |
tree | 4449f2036cccf162e8417cc5841a35815b3e7ac5 /src/pkg/time/tick.go | |
parent | c8bf49ef8a92e2337b69c14b9b88396efe498600 (diff) | |
download | golang-8a39ee361feb9bf46d728ff1ba4f07ca1d9610b1.tar.gz |
Imported Upstream version 1.3upstream/1.3
Diffstat (limited to 'src/pkg/time/tick.go')
-rw-r--r-- | src/pkg/time/tick.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/pkg/time/tick.go b/src/pkg/time/tick.go index b92c339c0..19007841e 100644 --- a/src/pkg/time/tick.go +++ b/src/pkg/time/tick.go @@ -17,6 +17,7 @@ type Ticker struct { // time with a period specified by the duration argument. // It adjusts the intervals or drops ticks to make up for slow receivers. // The duration d must be greater than zero; if not, NewTicker will panic. +// Stop the ticker to release associated resources. func NewTicker(d Duration) *Ticker { if d <= 0 { panic(errors.New("non-positive interval for NewTicker")) @@ -28,7 +29,7 @@ func NewTicker(d Duration) *Ticker { t := &Ticker{ C: c, r: runtimeTimer{ - when: nano() + int64(d), + when: when(d), period: int64(d), f: sendTime, arg: c, |