Expecting any program to keep working continuously for more than 248 days is, shall we say, optimistic! So it's not something that I would worry too much about, personally.I assume that TIME is considered as returning a signed integer when using it in comparisons as suggested in the documentation. (e.g. IF TIME>somevalue% THEN..)
In the situation of having several concurrent and asynchronous timeouts relying on TIME -- which are not regularly ticking timers that could be managed through TIMERLIB calls -- then after about 248 days of continuous operation, the above statement ("IF TIME>somevalue% THEN..") will not operate as wanted, i.e. timeouts won't work anymore.(for the next 248 days, as TIME would return a negative value.
Setting TIME to 0 at some point is not an option, as any currently running timeout will then be affected.
What options do I have?
But if this is a genuine concern, one way to tackle it is to fabricate a function which returns a 64-bit value of time rather than the usual 32-bit value:
Code: Select all
DEF FNtime64
LOCAL T%
PRIVATE t%, o%%
T% = TIME
IF T% < t% o%% += 2^32
t% = T%
= T% + o%%