Commit 7ab698b0 authored by Brad Fitzpatrick's avatar Brad Fitzpatrick

time: document that After uses memory until duration times out

Fixes #15698

Change-Id: I616fc06dcf04092bafdaf56fb1afba2a998a6d83
Reviewed-on: https://go-review.googlesource.com/23304Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
parent 054a721d
......@@ -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
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment