[SDL] Repeating timers
n5qmg at earthlink.net
Fri Apr 10 11:46:11 PDT 2009
Mason Wheeler wrote:
>> ----- Original Message ----
>> From: michael brown <n5qmg at earthlink.net>
>> Subject: Re: [SDL] Repeating timers
>> That's not what my tinkering showed. I found that if you set the
>> timer for 30mS, each callback will begin 30mS apart, even if you
>> delay 3mS in the callback routine. AIUI, returning zero from the
>> callback function cancels the timer and any other value just
>> continues the repitition. The timer only has 10mS granularity. I
>> hope they change this. ;-)
> Hang on. So returning some other number doesn't reset the timer or
> change the interval? The comment sure looks like it says that it
> should! Is this a glitch, or am I misunderstanding something?
Yes, it appears that the documentation that I read on that part was wrong.
Some testing I just did shows that the return value is important. Returning
0 doesn't appear to cancel the timer either. Still doing experiments.....
More information about the SDL