Computer Speeds

BlitzPlus Forums/BlitzPlus Beginners Area/Computer Speeds

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.

Use delta timing.


Function	DeltaTiming(period)

	If (MilliSecs() > (delta_timer + period)) Then 

		delta_timer=MilliSecs() ; 'reset' the timer 

		Return(True);
			
	End If 
	
	Return(False);

End Function


In your main loop put something like..

Global delta_timer = MilliSecs();

While( Not KeyHit(1))

   If(DeltaTiming(25)) Then

        UpdateControl();

        UpdateGraphics();

   End If

Wend



Just as an example but you should be able to get the idea.