When I wrote the below timer code some weeks ago, I deliberately tested if ElapsedMilliseconds() has cycled back round to zero, which I think I've done correctly (first conditional statement). But just thinking about it properly now, if the limit of 64-bit integer is 9,223,372,036,854,775,807 then divided by the number of milliseconds in a day, that would be 1,067,519 days.
Just wanted to check really, is there any way that ElapsedMilliseconds() could be reset, that I'm not aware of?
Code: Select all
; **
; ** Perform periodic reconnection attempts
; **
timernow.i = ElapsedMilliseconds() ; Time now
If timernow.i < timerlast.i ; Deal with ElapsedMilliseconds() time having reset back to zero
timerlast.i = 0 ; Reset the last time to deal with this case
EndIf
If timernow.i > timerlast + timerint.i ; Check for elapsed interval period
timerlast.i = timernow.i ; Set the last time to now

