As the title says... Chat on...

User avatar
By scargill
#4222 It occurred to me that the way to get around only having one timer - is to use that timer, say every second - to increment some variables and set flags...

So now we have in the background flags being set for all sorts of jobs you want to do from time to time... because any of those jobs might take longer than a second, I did not think it a good idea to run the jobs in the timer callback.

So, neively I tried this.

x=1

while x=1 do

if thistimer>10 do this

if thattimer>200 do that

end

Well except that it won't work because the forever loop prevents any background processes from working. Is there a CALL one can use to let those background processes run?

If I give you an example, back in the last century when we used VB6 you could call a function called doEvents() in a loop like this and it would allow the background processes to run - the timer, maybe a TCP listener etc...

If this can be done then one can have endless timers taking as long as one likes and not be limited by the existing single 30-odd second timer.

Any thoughts?