I think this is right

Blitz3D Forums/Blitz3D Beginners Area/I think this is right

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.

The value of 'oldtime' should be set to the current millisecs time after the 'millisecs - oldtime' line above rather than before it.

It's also a good idea to grab the value of the 'MilliSecs()' timer and stick it in a Global at the start of your main loop so you're not making repetitive calls to 'MilliSecs()'.

eg.

Global current_time
Global oldtime

;-----

current_time = MilliSecs()

time_elapsed = current_time - oldtime
oldtime = current_time