Code archives/3D Graphics - Misc/Frames per second

This code has been declared by its author to be Public Domain code.

Download source code

Frames per second by Kostik2002
This code is way better than the framecounter i usually see in other games/demos. It "counts" the frames and shows the counter every second, this means that you exactly see how many frames your mashine has done during the last gone second. (Again, excuse my english, just try it out and you'll see)
You must put this code between "RenderWorld" and "Flip"
;Framecounter--------------------------------------------
Framecounter_counter=Framecounter_counter+1
If Framecounter_time=0 Then Framecounter_time=MilliSecs()
If Framecounter_time+1001 <MilliSecs() Then
	Framecounter_framerate=Framecounter_counter
	Framecounter_counter=0
	Framecounter_time=MilliSecs()
EndIf
Text 10,10,"fps: "+Framecounter_framerate
;--------------------------------------------------------

Comments

None.

Code Archives Forum