Sam Rose @samwho.dev · Apr 30

How would you expect a Golang `Ticker` (pkg.go.dev/time#Ticker) to behave if it was configured to tick every 50ms but the receiver is reading off the channel only once every 60ms? Complete program below if you want to run and see for yourself.

2 likes 1 replies

?

Replies

Sam Rose · Apr 30

If you just want the answer, here it is. It effectively _becomes_ a 60ms ticker, with work happening every ~60ms in real time. But what surprised me is that the time that gets written into the channel increments by 50ms each time until it has to skip over a value, and it increments by ~100ms.