How to keep track of millis during sleep mode In my application, I need to keep track of the time the application has been running as well as use sleep modes. However, when using the sleep modes, Timer0 is disabled, and therefore millis stop counting. 

Is there a way to measure/count how long the Arduino was in sleep mode for?

To give you some more background info, this is what I'm trying to achieve:
I am using a pressure sensor which sends an interrupt to the Arduino every 80ms and wakes it up. 
The program does various routines to process the data which can take anywhere from 2ms to 60ms.
It then goes into sleep mode until another external interrupt occurs, approx 20-78ms later.
The application has many processes based on time, such as a stopwatch, timer and alarm, so I need to be able to keep track of this, preferably using millis().
The device is running on a single cell 250mah LiPo battery which at present only lasts about 4 hours.
I'm using an ATMega1284.

In most of the sleep modes Timer0 is disabled. Which means that millis() stops counting. Is there a way, without using an RTC (Both Space and weight are at a premium), to keep millis counting whilst in sleep mode? 

I notice that SLEEP_MODE_IDLE keeps Timer0 running, but that means that for every millisecond an interrupt wakes up the device. Please correct me if I'm wrong, but given that my loop can take about 60ms to execute, I don't see much advantage to sleeping for 1ms.

Possible solutions:


Use Timer2 for the millis function?
Use the Watchdog Timer to count how much time has passed whilst in
sleep mode and add this to millis() when waking up?
If there was a VERY small SMD RTC which didn't need any external
components such as oscilators etc then this might be feasible.
The only way to keep millis() running is sleep mode is to sleep in
SLEEP_MODE_IDLE. Switching to Timer 2 would make no difference, as
all timers but the watchdog are stopped in other sleep modes. The
watchdog is horribly inaccurate, so you do not want to rely on it for
any kind of timekeeping.


  I don't see much advantage to sleeping for 1 ms.


Sleeping for 1&nbsp;ms saves a little bit of power. But if you do that
60&nbsp;times every 80&nbsp;ms you will save a lot of power. I suggest
you do just that: sleep when you are done with your calculations. When
you wake up, if you see that the waking up came from the external
interrupt, the you process it. Otherwise you just go back to sleep.

Note that if the 80&nbsp;ms period of the external interrupt is
consistent enough, you could use that as time source.