Measure FPS
Monkey Forums/Monkey Programming/Measure FPS
| ||
I have done a search but couldn't find what I was looking for. How are you guys measuring FPS in the apps? Whats the most reliable way? |
| ||
My son stands next to me with a stopwatch while i try to count the refreshes.Method OnRender() RenderWorld() ' calculate fps renders=renders+1 If Millisecs()-old_ms>=1000 old_ms=Millisecs() fps=renders renders=0 Endif End |
| ||
Thanks Adam. |
| ||
I use something like:Local frameTime:Float = gameTime - lastFrame frameTime = Max( 0.01, Min( frameTime, 0.3 ) ) lastFrame = gameTime frameRate = frameRate * 0.75 + 0.25 / frameTime frameRate, gameTime, and lastFrame are persistent floats (i.e. fields or globals). The last line smooths the values reported, I think it's called an exponential moving average. You can tweak the 0.75 and 0.25, they must add to 1.0. |