mirror of
https://github.com/golang/go
synced 2024-10-14 03:43:28 +00:00
time: document that After uses memory until duration times out
Fixes #15698 Change-Id: I616fc06dcf04092bafdaf56fb1afba2a998a6d83 Reviewed-on: https://go-review.googlesource.com/23304 Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
parent
054a721dca
commit
7ab698b022
|
@ -106,6 +106,9 @@ func sendTime(c interface{}, seq uintptr) {
|
|||
// After waits for the duration to elapse and then sends the current time
|
||||
// on the returned channel.
|
||||
// It is equivalent to NewTimer(d).C.
|
||||
// The underlying Timer is not recovered by the garbage collector
|
||||
// until the timer fires. If efficiency is a concern, use NewTimer
|
||||
// instead and call Timer.Stop if the timer is no longer needed.
|
||||
func After(d Duration) <-chan Time {
|
||||
return NewTimer(d).C
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue