Introduction
This challenge is about using tickers in Golang. Tickers are used when you want to do something repeatedly at regular intervals.
This challenge is about using tickers in Golang. Tickers are used when you want to do something repeatedly at regular intervals.
In this challenge, you need to create a ticker that ticks every 500ms until we stop it. You will use a channel to await the values as they arrive.
time
package to create a ticker.select
statement to receive values from the channel.## When we run this program the ticker should tick 3 times
## before we stop it.
$ go run tickers.go
Tick at 2012-09-23 11:29:56.487625 -0700 PDT
Tick at 2012-09-23 11:29:56.988063 -0700 PDT
Tick at 2012-09-23 11:29:57.488076 -0700 PDT
Ticker stopped
In this challenge, you learned how to use tickers in Golang. You created a ticker that ticks every 500ms until we stop it, used a channel to await the values as they arrive, and stopped the ticker after 1600ms.