Frames Per Second

Blitz3D Forums/Blitz3D Beginners Area/Frames Per Second

Maximus Primal(Posted 2005) [#1]
How go I get the correct Frames Per Second count for my code? I cannot see a command that gives it out so I assume you must code a routine to calculate it?

Thanks

Max


Rob Farley(Posted 2005) [#2]
There's not. Plenty of FPS counters in the code archives though.


WolRon(Posted 2005) [#3]
Check out my frame-limiter at my programming tutorial.


Ross C(Posted 2005) [#4]
The methods involve having a timer variable. Each frame add one to a counter, and check to see if a second has passed on the timer. If it has, the value in the counter variable is your FPS.


Rob Farley(Posted 2005) [#5]
Or... My way is to count 10 frames and see how long it took to do those frames.


Raitsun(Posted 2005) [#6]
    
time=MilliSecs()
fps#=1000/(time-time2)
time2=tt
Text ´10,10,"FPS: "+Int(fps#)


That's a simple Way to add a fps counter.

mfg Raitsun


Réno(Posted 2005) [#7]
>fps#=1000/(time-time2)
will always return an int like this.

Do instead :
fps#=1000.0/(time-time2)