ElapsedMilliseconds() returns negative value

Mac OSX specific forum
pantsonhead
User
User
Posts: 39
Joined: Fri Mar 26, 2004 1:47 pm
Location: London, UK
Contact:

ElapsedMilliseconds() returns negative value

Post by pantsonhead »

I noticed that ElapsedMilliseconds() returns negative value in OSX but not on my PC.
Is it a negative value on purpose or a type/sign problem?

Code: Select all

For i = 1 To 100
  Delay(100)
  Debug Str(i)+" "+Str(ElapsedMilliseconds())
Next
I assume it returns a positive int on Linux and AmigaOS platforms.
Fred
Administrator
Administrator
Posts: 16686
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

It's now corrected.
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6161
Joined: Sat May 17, 2003 11:31 am
Contact:

Post by blueznl »

fred, isn't a wraparound possible? i assume you're reading one of the 32 bit counters?
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
Fred
Administrator
Administrator
Posts: 16686
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

no, it's not possible as the counter is reseted at every program launch, and can hold 2^31 milliseconds. Just do the calc :).
Post Reply