Mark McGranaghan 5c8ddea5ff updatges
2012-09-23 11:33:17 -07:00

19 lines
324 B
Go

// ## Tickers
package main
import "time"
import "fmt"
func main() {
ticker := time.NewTicker(time.Millisecond * 500)
go func() {
for t := range ticker.C {
fmt.Println("Tick at", t)
}
}()
time.Sleep(time.Millisecond * 1500)
ticker.Stop()
fmt.Println("Ticker stopped")
}