]> Cypherpunks repositories - gostls13.git/commit
time: add AfterFunc to call a function after a given duration.
authorRoger Peppe <rogpeppe@gmail.com>
Mon, 10 Jan 2011 19:51:38 +0000 (11:51 -0800)
committerRob Pike <r@golang.org>
Mon, 10 Jan 2011 19:51:38 +0000 (11:51 -0800)
commit212e074be2bf8be3639250050ce9867d690f7b2c
treebd798c0841e991fdef3d82fe4130b7d767c0170b
parent23410ced69b90ded4aacde12e40c162c6568e8db
time: add AfterFunc to call a function after a given duration.
The After code is trivially generalisable to provide support
for this, and it is possible to use AfterFunc to do
things that After cannot, such as waiting
for many events at varied times without an overhead
of one goroutine per event.

R=rsc, r
CC=golang-dev
https://golang.org/cl/3905041
src/pkg/time/sleep.go
src/pkg/time/sleep_test.go