Interrupt: Need to keep track of time spent in routine or ... ?

[quote author=Nick Gammon link=topic=123886.msg931355#msg931355 date=1348274230]

With interrupts disabled (as they are inside an interrupt) you can't keep track of time any more. Thus you can't "fix" the millis() value. The approach is fundamentally flawed. [/quote]

That's what I was asking: is there a way to keep track of time through some sneaky manipulations or using the watchdog timer somehow. Evidently there is not.

From what you've described some sort of table of devices that are currently turned off would be all you require, and after X milliseconds elapse, you turn them on again and remove them from the table.

One approach that springs to mind BTW is just to use a RTC (real time clock) external chip. That will give you your "actual time" regardless of what the program is doing.

In essence, yes. If a short occurs, I need the Arduino to detect it, stop the program and shut off the offending device, wait a little bit, then start turning on devices as scheduled prior to the interlude.

Thanks for the suggestion on an external clock. I'll have to look into that.