[SailfishDevel] QML Timer stops running

Thomas Tanghus thomas at tanghus.net
Tue Jan 14 01:14:58 UTC 2014

On Tuesday 14 January 2014 01:53 Ove Kåven wrote:
> Den 13. jan. 2014 23:04, skrev Thomas Tanghus:
> > Just after having my tiny Kitchen Timer app approved I realized that the
> > timer slows down and eventually stops running - burned food as result :(
> > 
> > The timer is set to trigger each 1000 ms. When applicationActive becomes
> > false the timer slows down to being triggered appr. each 5000 ms and after
> > about a minute more it stops running all together.
> > 
> > Am I missing something obvious?
> No matter what OS or platform you're on, counting the number of times
> your timer callback is called is *never* a good idea, even on desktop
> PCs. Timer callbacks can be skipped for any number of reasons (heavy
> system load, laptop suspend, etc).
> If you look at the QML example code for Timer, they don't do that. They
> use Date() to get the current time. You should do something like that,
> too. Then your clock would always show the correct time (as long as it's
> running at all, at least).

Good point. That will also at least work around the issue when in "pre-deep-

Med venlig hilsen / Best Regards

Thomas Tanghus

More information about the Devel mailing list