Millisecs() Overrun?

Archives Forums/BlitzMax Bug Reports/Millisecs() Overrun?

Midimaster(Posted 2009) [#1]
I had a strange behavior in one of my programs some weeks ago. Now I thought about a possible reason, and had an idea. But I do not know, if this was a bug in BlitzMax...

What happened:

I got negative values with the function Millisecs() for some days. My computer was running for more than a month without Restart at that time. After restarting the computer the problem was away.

My idea:

Is it possible, that the function gets negativ? What Data Type does Millisecs() returns? 32bit or 64bit? If it is 32bit, it could overrun after 25 days and could become negativ. From this moment the "Millisecs() of now" > "Millisecs() of future".

Sorry, but cannot 100% remember, whether Millisecs() was negativ or only my variable time% was negativ. So please remove the topic, if this is not a bug.


Brucey(Posted 2009) [#2]
Millisecs() returns an Int. So, in time, it will roll over into negative, eventually returning to positive.
There are several ways to keep using Millisecs() when this happens.


It's not a bug. It's a feature :-)


Midimaster(Posted 2009) [#3]
thanks for the link to the topic. I searched for something like this yesterday, but I did not find it. Now I see, I was not the first, who notized that...

But wouldn't it be better to include a 64bit timer function in a coming version? Or a ResetMillisecs()- Function. I believe, that a lot of game programers use the BlitzMax Millisecs()-function without thinking about that on the end-users-machine it might get problems.