Page 1 of 1

Using non-blocking algorhythm for clock

Posted: Sun Feb 08, 2015 10:56 pm
by Ultravibe
Hello!
I made the clock by using non-blocking algorhythm (send the specific message to object and it execute specific handle after specific delay = 1 sec).
Clock is working, but during one minute apears a delay about 0.5 sec. And it's increasing! Why is it so?

Re: Using non-blocking algorhythm for clock

Posted: Sun Feb 08, 2015 11:06 pm
by FourthWorld
Timers generally fire on first available idle after expiration. What is the rest of your app doing during the timer interval?

Re: Using non-blocking algorhythm for clock

Posted: Sun Feb 08, 2015 11:06 pm
by dunbarx
Hi.

I have not seen your code, but perhaps search for "Accurate timer" in these forums. This suggests reading one or more of the system times, instead of starting and maintaining a counter. Maybe something like that is tying up your app.

Craig Newman

Re: Using non-blocking algorhythm for clock

Posted: Mon Feb 09, 2015 6:12 am
by Ultravibe
FourthWorld, my app is doing nothing yet (and delay is already apears). But what will be if i add some program code to operate some objects? My clock will "swim" and delay becomes biger?

Re: Using non-blocking algorhythm for clock

Posted: Mon Feb 09, 2015 10:49 pm
by dunbarx
Ultravibe.

Go to this and play around:

http://forums.livecode.com/viewtopic.ph ... rate+timer

Craig