Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

eldee

average framerate question

This topic is 5772 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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!

Share this post


Link to post
Share on other sites
Advertisement
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?

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Give me a break!

The CPU cycles for one division are probably less than it''ll take to write the data to the log!

TO worry about a single division you''d must be developing on a 386sx

Share this post


Link to post
Share on other sites
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!

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Actually, multiplication is slightly faster than division - I think.
Anyways, both are execute in only a few clock cycles (maybe they have got it down to 1 nowadays, it''s been a while since I''ve seen a cpu spec). Either way, a division is not far off a memory access. Think hundreds of thousands per second.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
*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.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!