Since FPS is so important, I want to make sure I didn’t make some sort of typical newbie programmer mistake here. If so, please straighten me out.
private void displayFrameRate(GL gl)
{
// num frames since last update
frameCount++;
// time passed since last update
timeDelta = System.currentTimeMillis() - oldTime;
// if it's been longer than a quarter second, update
if(timeDelta >= 250)
{
// calculate current fps
fps = (frameCount * 1000.0f) / timeDelta;
// oldTime becomes the current time
oldTime = System.currentTimeMillis();
// reset frame count
frameCount = 0;
//...
}
}
Thanks