CTime::ScanFramerate()
{
TmCurrentTime=clock();
TmFrames++;
if (((TmCurrentTime-TmLastTime)*TmFrames)>=(1*CLOCKS_PER_SEC))
{
TmFramerate=TmFrames;
TmFrames=0;
}
TmLastTime=TmCurrentTime;
return 0;
}
I think it works but i don't know if it works really good or not...So i wait an answer... :) Tnx, bye! [Edited by - Zuck on February 13, 2005 6:11:23 AM]
Help: calculate framerate!
Hi, sorry but this is my first post... :P Now, how i can calculate the framerate of my scene? What do you think about this routine?
Uhm...Probabily this code is better than last one:
Results are very different...With only a texturized sprite in a black screen, in the first case the framerate is about 100FPS and in the second one is about 500FPS...What is the right one?
CTime::ScanFramerate(){ TmCurrentTime=clock(); TmFrames++; TmAcuDelay=TmAcuDelay+(TmCurrentTime-TmLastTime); if (TmAcuDelay>=(1*CLOCKS_PER_SEC)) { TmFramerate=TmFrames; TmFrames=0; TmAcuDelay=0; } TmLastTime=TmCurrentTime; return 0;}
Results are very different...With only a texturized sprite in a black screen, in the first case the framerate is about 100FPS and in the second one is about 500FPS...What is the right one?
um the second one, the first one asumes that all frames takes the same time, witch they don't.
www.flashbang.se | www.thegeekstate.com | nehe.gamedev.net | glAux fix for lesson 6 | [twitter]thegeekstate[/twitter]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement