Getting FPS?

Blitz3D Forums/Blitz3D Programming/Getting FPS?

MikeP (Dark Mist Software)(Posted 2006) [#1]
How can i get the FPS my game is running at?


Matty(Posted 2006) [#2]
in your main loop do something like this:


;main loop
repeat


;all your normal stuff here...

updateworld
renderworld
fpscounter=fpscounter+1
if millisecs()-fpstime>1000 then 
fps=fpscounter
fpscounter=0
endif 
text 0,0,"Frame rate:"+fps
if fps>0 then text 0,15,"Better value is millisecs per frame:"+float(1000.0)/float(fps)
flip false

until gameover or keydown(1)




WolRon(Posted 2006) [#3]
Check out the frame limiting code (among other things) on my programming tutorial website.