05-22-2018 06:10
05-22-2018 06:10
I thought I understood this but now I'm not sure. Does the ontick event fire when the display is off? I'm pretty sure I saw somewhere that it doesn't but lots of the examples test display.on to minimize cpu impact. That test shouldn't be needed if the ontick only fired when the display is on.
And if it doesn't fire when the display is off, is the only solution to processing continuously is to use setInterval?
Thanks,
John
Answered! Go to the Best Answer.
05-22-2018 16:18 - edited 05-22-2018 16:19
05-22-2018 16:18 - edited 05-22-2018 16:19
The ontick event does not fire when the clock face display is off - if you need to do any limited background operation while so then setInterval() is the way to do so.
When an app is run, like sliding up to see Today, the clock is totally off including setinterval(). No background operation.
05-22-2018 16:18 - edited 05-22-2018 16:19
05-22-2018 16:18 - edited 05-22-2018 16:19
The ontick event does not fire when the clock face display is off - if you need to do any limited background operation while so then setInterval() is the way to do so.
When an app is run, like sliding up to see Today, the clock is totally off including setinterval(). No background operation.
05-22-2018 18:27
05-22-2018 18:27
Thanks. That is what my tests had shown but seemed to conflict with what I had read.
Probably my defective memory.
John
05-23-2018 09:28 - edited 08-09-2019 12:26
05-23-2018 09:28 - edited 08-09-2019 12:26
@Drifty26 Thanks for the tip. We have a routine that runs every minute and it seems that the Clock OnTick event (with minutes granularity) is only fired when the Display is On and when waking up the screen through tapping. Since waking up the screen fires even though the tick interval (in our case in every minute) has yet to fire, the variables get out of sync.
I created a separate function that handles the variables and now using the setInterval to call that function as you guys have noted. Thanks!