Timing, How Does Your App Fare?

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

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?