每隔1秒打印一下时间 12345678910111213141516package mainimport ( "fmt" "time")func main() { ticker := time.NewTicker(time.Millisecond * 1000) go func() { for t := range ticker.C { fmt.Println("Tick at", t) } }() select {} // select 就好}