I have googled and searched these forums but can't find an answer.
How can I determine what is the max / overflow values for:
1) time.time()
2) time.ticks_cpu()
3) time.ticks_ms()
4) time.ticks_us()
I know that ticks_ms and ticks_us can handle rollover / overflow, but is there a maximum period that they can measure ?
Many Thanks
Overflow values for time counters
Re: Overflow values for time counters
OK, I can't use ticks as that gets reset after deepsleep, so what I am looking for is the max / overflow value for time.time()
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: Overflow values for time counters
On bare metal ports utime.time() returns an integer as a number of seconds since Y2K. Since Python integers have arbitrary precision it should never overflow. The RTC hardware on STM chips looks like it supports dates up to 2099.
But to some extent I'm guessing, I haven't trawled through ports/stm32/rtc.c.
You don't mention your hardware but as far as I can recall the ESP8266 RTC breaks after about 7 hours.
But to some extent I'm guessing, I haven't trawled through ports/stm32/rtc.c.
You don't mention your hardware but as far as I can recall the ESP8266 RTC breaks after about 7 hours.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.