1
0
mirror of https://github.com/golang/go synced 2024-09-24 21:10:12 -06: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:
Brad Fitzpatrick 2016-05-20 22:43:14 +00:00
parent 054a721dca
commit 7ab698b022

View File

@ -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
}