Mark McGranaghan e4b083d49b index work
2012-09-23 17:45:04 -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")
}