Timing, How Does Your App Fare?

Miscellaneous Forums/General Discussion/Timing, How Does Your App Fare?

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.

In Mark's insectoid demo, he used...
time=MilliSecs()

While Not KeyHit(1)

	n_time=MilliSecs()
	elapsed=n_time-time
	If elapsed>25		;slowing down! - clamp update to 40 FPS (1000/40=25 millisecs)
		cnt=elapsed/25
		For k=1 To cnt
			UpdateGame()
		Next
		time=time+cnt*25
	Else				;leave frame synced...
		UpdateGame()
		time=n_time
	EndIf
	
	RenderGame()
	
	Flip
Wend
If that helps any?