Long period (hours) millisecond timing

06 Jun 2012

I'm working on an application that requires long period millisecond timing. The timing could run into several hours. Knowing that there is a 30 minute limit on timer functions I was wondering what would be the best way to make use of the millisecond timing available but extend it's operating time.

My current plan is to look at using a Ticker set to 1,10 or 30 minutes and every time it fires, increment an integer and reset a timer. I can then recontruct the full timing by adding interval*triggers to the value of the timer.

Is this sensible? Is there a more reliable/accurate way to run this?

Joe

06 Jun 2012

Actually, the max value of read_us() is 4294967295, which is 4294.9 sec or 71.58 minutes. I believe the RTC is more accurate (less drift) than the read_ms() or read_us(), so if I were you, I will check one hour period reading the RTC, then reset timer for reading remainder of hours.