🎉 Celebrating 25 Years of GameDev.net! 🎉
Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!
[Newbie] How to find out the FRAME RATES per SECOND?
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-
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
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
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement