Re: Problem With Timer Inaccuracy

262 views
Skip to first unread message

Christopher Calmes

unread,
Mar 5, 2014, 6:56:35 AM3/5/14
to mitappinv...@googlegroups.com
Whoops forgot the screenshots

Design: https://www.dropbox.com/s/u997fssm7qldfmn/Screenshot%202014-03-05%2019.56.22.png

On Wednesday, March 5, 2014 7:53:44 PM UTC+8, Christopher Calmes wrote:
Hello!! I have been making programs with app inventor classic for a couple of years just for fun and just migrated to MIT app inventor 2. I made an app that utilizes a timer that fires every 100 milliseconds and then I devide it by ten to get tenths of seconds. The problem is, some of my users have noticed that the app's timer is slow. About 16% slow. I cannot think of any reason why this would be, but maybe you could take a look at my blocks. The notifier timer just keeps the screen on.






Taifun

unread,
Mar 5, 2014, 9:34:13 AM3/5/14
to mitappinv...@googlegroups.com
you might be interested in reading more here https://sites.google.com/site/blocks123/theclock about the clock...
Taifun

Trying to push the limits of App Inventor! Snippets and Tutorials from Pura Vida Apps by Taifun.         



Working with the Timer I find that the TimerInterval is from the time you exit the .Timer procedure until it restarts, ie if TimerInterval is 1000ms (1 second) and it takes 45ms for the phone to do your blocks the total time between any one block will be 1045ms. 
 

Remember that your App is not the only thing running on the phone. If it's time for your Timer to go off and the phone is busy doing something else, your event will be delayed until the phone can get to it. 

Christopher Calmes

unread,
Mar 7, 2014, 3:08:27 AM3/7/14
to mitappinv...@googlegroups.com
What do you think would be a solution? Should I just reduce the Timer interval?

Taifun

unread,
Mar 7, 2014, 9:00:49 AM3/7/14
to mitappinv...@googlegroups.com
I made an app that utilizes a timer that fires every 100 milliseconds and then I devide it by ten to get tenths of seconds. The problem is, some of my users have noticed that the app's timer is slow. About 16% slow.
as you can see from the link, the clock is not accurate
taking a look at your screenshot unfortunately I can't see, waht you are trying to do
is this a stopwatch example somehow?
if yes, you should take the start time and the end time and the difference of both times is the correct duration
Taifun
Reply all
Reply to author
Forward
Message has been deleted
0 new messages