Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Confused about clock ontick - does it fire with when the display is off?

ANSWERED

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

Best Answer
0 Votes
1 BEST ANSWER

Accepted Solutions

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.

 

View best answer in original post

Best Answer
0 Votes
3 REPLIES 3

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.

 

Best Answer
0 Votes

Thanks.  That is what my tests had shown but seemed to conflict with what I had read.

 

Probably my defective memory. Smiley Happy

 

John

Best Answer
0 Votes

@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!

Best Answer
0 Votes