MilliSecs : How do I count seconds

BlitzMax Forums/BlitzMax Beginners Area/MilliSecs : How do I count seconds

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

But you can't compare the time as Warren suggests. "If Millisecs()>StartTime+30000" will fail due to MilliSecs() rollover, however "If Millisecs()-StartTime>30000" doesn't.

This is especially true on Linux where MilliSecs returns millis since January1,1970 or something so is more ofen than not a negative value in BlitzMax's signed world.
Global StartTime=MilliSecs()

' test timeout in code

Local runningtime=(MilliSecs()-StartTime)/1000
If runningtime>30 end ' time out after 30 seconds