A common idiom is to keep a single timer and extend its
use by calling Timer.Reset.
From a naive reading of the documentation, these two
lines are equivalent except for saving some garbage:
t.Reset(x)
t := time.NewTimer(x)
Unfortunately t.C is buffered, so if the timer has just expired,
the newly reset timer can actually trigger immediately.
The safe way to do it might be someting like:
t.Stop()
select {
case <-t.C:
default:
}
t.Reset(x)
but this is cumbersome. Perhaps we could change Reset to do this
as a matter of course.