blob: 279067bd3a0c39eeebbd1353ce4d55c4d94c795e [file] [log] [blame]
// +build OMIT
package main
import (
"fmt"
"math/rand"
"time"
)
func main() {
start := time.Now()
reset := make(chan bool)
var t *time.Timer
t = time.AfterFunc(randomDuration(), func() {
fmt.Println(time.Now().Sub(start))
reset <- true
})
for time.Since(start) < 5*time.Second {
<-reset
t.Reset(randomDuration())
}
}
func randomDuration() time.Duration {
return time.Duration(rand.Int63n(1e9))
}