Using non-blocking algorhythm for clock

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Ultravibe
Posts: 65
Joined: Sat Jan 17, 2015 12:06 pm

Using non-blocking algorhythm for clock

Post by Ultravibe » Sun Feb 08, 2015 10:56 pm

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?

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10057
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Using non-blocking algorhythm for clock

Post by FourthWorld » Sun Feb 08, 2015 11:06 pm

Timers generally fire on first available idle after expiration. What is the rest of your app doing during the timer interval?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10354
Joined: Wed May 06, 2009 2:28 pm

Re: Using non-blocking algorhythm for clock

Post by dunbarx » Sun Feb 08, 2015 11:06 pm

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

Ultravibe
Posts: 65
Joined: Sat Jan 17, 2015 12:06 pm

Re: Using non-blocking algorhythm for clock

Post by Ultravibe » Mon Feb 09, 2015 6:12 am

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?

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10354
Joined: Wed May 06, 2009 2:28 pm

Re: Using non-blocking algorhythm for clock

Post by dunbarx » Mon Feb 09, 2015 10:49 pm

Ultravibe.

Go to this and play around:

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

Craig

Post Reply