Sign in
go
/
website
/
6fcd42d2ce3ee1bca61e3878571960c9d7eeb01e
/
.
/
_content
/
blog
/
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
}
}
}