Skip to content

Instantly share code, notes, and snippets.

@axgle
Last active August 29, 2015 13:57
Show Gist options
  • Save axgle/9776033 to your computer and use it in GitHub Desktop.
Save axgle/9776033 to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
//"runtime"
"time"
)
func main() {
//runtime.GOMAXPROCS(4)
t := time.Tick(time.Second)
ti := time.After(time.Second * 4) //random 3 or 4 lines output?
for {
select {
case <-ti:
return
case <-t:
fmt.Println("now:", time.Now().Format("06-1-02 03:04:05"))//https://github.com/polaris1119/times/blob/master/times.go
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment