[go-nuts] dynamic frequency ticker

2016-08-30 Thread seb . stark
In my application I select on a ticker channel, but sometimes need to have the waiting time vary a bit. For not so frequent changes I could make a new ticker everytime, but I have the feeling this is not the best solution for higher frequencies and many rate changes. Best would be if I could tel

Re: [go-nuts] dynamic frequency ticker

2016-08-30 Thread seb . stark
Interesting. But it would give me two interfering frequencies at the same time, which is not what I want. Also it feels inflexible that for every possible frequency I would have to hardcode a separate select branch. Thanks anyway. Am Dienstag, 30. August 2016 21:46:46 UTC+2 schrieb freeformz:

Re: [go-nuts] dynamic frequency ticker

2016-08-30 Thread seb . stark
The problem I have with time.Sleep is that I am totally relying on the "exact" time guarantee a Ticker gives me. What I mean is that with a Ticker I can be sure that if it fires every 50ms, no matter what my code does (, after 10 minutes it ran exactly 12000 times. I don't know how I would do t

Re: [go-nuts] Re: dynamic frequency ticker

2016-09-01 Thread seb . stark
This works great, thank you! And with minimal changes to my existing code (that's why I didn't like so much the other proposals that use time.After or time.Timer, but thanks anyway!). Am Mittwoch, 31. August 2016 16:06:58 UTC+2 schrieb Marvin Renich: > > > Does this do what you want? > > https