05-22-2018 06:10
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

05-22-2018 06:10
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
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.

Accepted Solutions
05-22-2018 16:18 - edited 05-22-2018 16:19
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

05-22-2018 16:18 - edited 05-22-2018 16:19
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
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
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

05-22-2018 16:18 - edited 05-22-2018 16:19
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
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
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

05-22-2018 18:27
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
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
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

05-23-2018 09:28 - edited 08-09-2019 12:26
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
@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!

