Polygons and Frames Per Second

Blitz3D Forums/Blitz3D Beginners Area/Polygons and Frames Per Second

Here's the FPS counter code I use.

	; -- Frames Per Second counter.
	; Place into the main program loop where it will be executed each frame, after 'RenderWorld' but before 'Flip'. The variables used here do not need to be declared globlly as this will occur automatically if the routine is placed in the main program. The value of 'milli_secs' should be set from the 'MilliSecs()' Blitz function at the start of the main program loop.
	FPS_framecounter = FPS_framecounter + 1
	If milli_secs >= FPS_timeout
		FPS_timeout = milli_secs + 1000
		FPS_framecount = FPS_framecounter
		FPS_framecounter = 0
	EndIf
	Text 10, 10, "FPS"
	Text 40, 10, FPS_framecount
	;^^^^^^