mirror of
https://github.com/golang/go
synced 2024-11-22 02:54:39 -07:00
time: fix godoc for After and NewTicker.
R=golang-dev, gri, bradfitz, iant CC=golang-dev, rsc https://golang.org/cl/5523049
This commit is contained in:
parent
a15448d65e
commit
1379d90651
@ -41,7 +41,7 @@ func (t *Timer) Stop() (ok bool) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// NewTimer creates a new Timer that will send
|
// NewTimer creates a new Timer that will send
|
||||||
// the current time on its channel after at least ns nanoseconds.
|
// the current time on its channel after at least duration d.
|
||||||
func NewTimer(d Duration) *Timer {
|
func NewTimer(d Duration) *Timer {
|
||||||
c := make(chan Time, 1)
|
c := make(chan Time, 1)
|
||||||
t := &Timer{
|
t := &Timer{
|
||||||
@ -70,7 +70,7 @@ func sendTime(now int64, c interface{}) {
|
|||||||
|
|
||||||
// After waits for the duration to elapse and then sends the current time
|
// After waits for the duration to elapse and then sends the current time
|
||||||
// on the returned channel.
|
// on the returned channel.
|
||||||
// It is equivalent to NewTimer(ns).C.
|
// It is equivalent to NewTimer(d).C.
|
||||||
func After(d Duration) <-chan Time {
|
func After(d Duration) <-chan Time {
|
||||||
return NewTimer(d).C
|
return NewTimer(d).C
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,7 @@ type Ticker struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// NewTicker returns a new Ticker containing a channel that will send the
|
// NewTicker returns a new Ticker containing a channel that will send the
|
||||||
// time, in nanoseconds, with a period specified by the duration argument.
|
// time with a period specified by the duration argument.
|
||||||
// It adjusts the intervals or drops ticks to make up for slow receivers.
|
// 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.
|
// The duration d must be greater than zero; if not, NewTicker will panic.
|
||||||
func NewTicker(d Duration) *Ticker {
|
func NewTicker(d Duration) *Ticker {
|
||||||
|
Loading…
Reference in New Issue
Block a user