Frames Per Second
Blitz3D Forums/Blitz3D Beginners Area/Frames Per Second
| ||
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 |
| ||
There's not. Plenty of FPS counters in the code archives though. |
| ||
Check out my frame-limiter at my programming tutorial. |
| ||
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. |
| ||
Or... My way is to count 10 frames and see how long it took to do those frames. |
| ||
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 |
| ||
>fps#=1000/(time-time2) will always return an int like this. Do instead : fps#=1000.0/(time-time2) |