Jump to content
  • Advertisement

Archived

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

Pure Krome

[Newbie] How to find out the FRAME RATES per SECOND?

This topic is 6669 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

Heya all. How do i find out the frame rates per second on any of the tutorials? As in, are there any tutorials explaining how to code / determine the FPS ?? -PK-

Share this post


Link to post
Share on other sites
Advertisement
Here is one way to do it:

Call this function from your message pump:

/* code start

int g_iFPS; //gloabal int variable to store frame rate
#include // For timeGetTime

void FrameRate()
{
static int iFramesPerSecond;
static DWORD iLastTimeValue;
iFramesPerSecond++;

if(timeGetTime() - iLastTimeValue >= 1000)
{
g_iFPS = iFramesPerSecond;
iFramesPerSecond = 0;
iLastTimeValue = timeGetTime();
}
}

*/ code end }

Gandalf the White



Edited by - Gandalf on June 16, 2000 5:59:51 AM

Edited by - Gandalf on June 16, 2000 6:00:46 AM

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!