Skip to main content
gamedev.net
🔒 Locked

average framerate question

Started by eldee 6 replies 250+ views
Original Post
eldee
eldee
i want to log the average framerate of my game.. not the lowest + the highest / 2 either..the actual average. the only thing i could think of was to calculate the actual average every single frame.. but that''s alot of division (read: slow). is there a better way? or am i best of going with the division routes. -eldee ;another space monkey; [ Forced Evolution Studios ]

::evolve:: Do NOT let Dr. Mario touch your genitals. He is not a real doctor!

NeonGE
NeonGE
Well, you don´t need to do it every single frame.
Create a variable that hold the sum of your frame rate every second and other that indicates the time of your aplication since it was started, at the exit you can calculate the average frame rate.

Hope this helps

If God with me, Who against me?
--------------------------------------------- If God with me, Who against me?Personal Web Samuel Prince Blog...
eldee
eldee
AP: the thought definately crossed my mind, but im not sure of
the actual time it takes for a division operation. which is why
i asked
thanks for clarifying though.

-eldee
;another space monkey;
[ Forced Evolution Studios ]

::evolve::

Do NOT let Dr. Mario touch your genitals. He is not a real doctor!

python_regious
python_regious
Hundreds of thousands? Go up a few more magnetudes...

Death of one is a tragedy, death of a million is just a statistic.
If at first you don't succeed, redefine success.
daggerr
daggerr
i''m not sure, but i think a floatingpoint division takes about 30 cycles.... anyway as mentioned before, u probably have a lot of other divisions, and one more per frame wouldnt hurt
Ysaneya
Ysaneya
*cry* On our computers we can do hundred of millions of divisions per second...

Come on, doing a few thousands per frame wouldn''t even slow it down by a millisecond..

Y.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.