void CalculateFrameRate() { static float framesPerSecond = 0.0f; // This will store our fps static float lastTime = 0.0f; // This will hold
You should put it in the display loop. Here's an article that explains some intricacies of game loops that you should read.