[go-nuts] Re: time.Ticker's behavior

2020-05-26 Thread Kai Zhang
Hello, It really help,I scan the go source and I can see the ticker.C is 1-element channel.maybe I should just treate it as a normal channel.but the value in channel is Time.Now I am seek how the later ticker be dropped.because the source code said // NewTicker returns a new Ticker containi

[go-nuts] Re: time.Ticker's behavior

2020-05-25 Thread Jake Montgomery
I'll take a crack at it. The behavior you see is one tick about 100ms after start, a second one marked as 200ms after start, then one 1200ms, one at 2200, and another at 3200ms after start. The key is in the documentation for NewTicke r: "It adjusts the i

[go-nuts] Re: time.Ticker's behavior

2020-05-25 Thread Brian Candler
You asked for ticks at 100ms intervals, but your receiver has a time.Sleep(1*time.Second). See https://golang.org/pkg/time/#NewTicker "It adjusts the intervals or drops ticks to make up for slow receivers." -- You received this message because you are subscribed to the Google Groups "golang-nu