Sign in
go
/
blog
/
faf1e2da2d911edc717993e8edb24fe88f99b2b5
/
.
/
content
/
playground
/
time.go
blob: fb1f31496e82ddeeac0e32e8d761df1e389c7430 [
file
] [
log
] [
blame
]
// +build OMIT
package main
import (
"fmt"
"time"
)
func main() {
stop := time.After(3 * time.Second)
tick := time.NewTicker(1 * time.Second)
defer tick.Stop()
for {
select {
case <-tick.C:
fmt.Println(time.Now())
case <-stop:
return
}
}
}