diff options
| author | Katie Hockman <katie@golang.org> | 2020-12-14 10:03:05 -0500 |
|---|---|---|
| committer | Katie Hockman <katie@golang.org> | 2020-12-14 10:06:13 -0500 |
| commit | 0345ede87ee12698988973884cfc0fd3d499dffd (patch) | |
| tree | 7123cff141ee5661208d2f5f437b8f5252ac7f6a /src/time/tick.go | |
| parent | 4651d6b267818b0e0d128a5443289717c4bb8cbc (diff) | |
| parent | 0a02371b0576964e81c3b40d328db9a3ef3b031b (diff) | |
| download | go-0345ede87ee12698988973884cfc0fd3d499dffd.tar.xz | |
[dev.fuzz] all: merge master into dev.fuzz
Change-Id: I5d8c8329ccc9d747bd81ade6b1cb7cb8ae2e94b2
Diffstat (limited to 'src/time/tick.go')
| -rw-r--r-- | src/time/tick.go | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/time/tick.go b/src/time/tick.go index 152d5a706b..81d2a43f28 100644 --- a/src/time/tick.go +++ b/src/time/tick.go @@ -6,18 +6,19 @@ package time import "errors" -// A Ticker holds a channel that delivers `ticks' of a clock +// A Ticker holds a channel that delivers ``ticks'' of a clock // at intervals. type Ticker struct { C <-chan Time // The channel on which the ticks are delivered. r runtimeTimer } -// NewTicker returns a new Ticker containing a channel that will send the -// 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. +// NewTicker returns a new Ticker containing a channel that will send +// the time on the channel after each tick. The period of the ticks is +// specified by the duration argument. The ticker will adjust the time +// interval or drop 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")) |
