millis vs sleep

Hello all,

I have (hopefully) a quick question...

When the processor is put to sleep with SLEEP_MODE_PWR_DOWN or SLEEP_MODE_STANDBY does millis continue to "run"?

Thanks, Brian

Millis() halts when using SLEEP_MODE_PWR_DOWN (based on what I've experienced), but I'm not sure about that stand by mode. There's a rather quick way to confirm it, though: write a code that sends the value of the millis() at start up and then goes to sleep mode (interrupts enabled). Wait some time before pulling your interrupt pin low. In the code, make the program to send the current millis() after wake up. Based on these two values you should be able to tell, whether milis() continue to run or not.

Thanks. That's exactly what I needed. I was concerned there was a problem with my code; that I had accidentally turned off Timer0.

  • Brian