   Working out FPS
  Hi im in the middle of testing my game now and i want to find the average fps i know how to display text so all i need to know is how i work out the fps so i can put it into a variable named fps then i can display itim grateful for any helpthanx Matt   
  You should keep track of the number of frames rendered between two time points. To get more accurate measures, let more frames pass.So:- query the current time (T1)- wait until for example 100 frames are done- query the current time (T2)The FPS is, averaged over the last 100 frames, 100/(T2-T1).Illco   ;  Hey that helps but how would i program it im using C++ would i program the start timer at the beginning of my game loop and then work out the difference at the end of the loop.ps bumping your ratingthanx   ;  If your game uses either DirectX or OpenGL, you can use FRAPS to see the FPS rate, it's small and simple to use.http://www.fraps.com/;Quote:Original post by cNoobwould i program the start timer at the beginning of my game loop and then work out the difference at the end of the loop.You could do that but it would compute the FPS over one frame only, which gives poor performance because it is very flaky. It would be better to adjust the frame rate only once every, say, 100 frames.The following psuedo code gives an idea:// Initialization (before first loop iteration)time_t nLastTime = GetCurrentTime();int nNumFramesElapsed = 0;float fFPS = 0.0f;// Game loopwhile( true ){  UpdateWorld();  RenderFrame();  // Update FPS once every 100 frames  nNumFramesElapsed = (nNumFramesElapsed + 1) % 100;  if ( nNumFramesElapsed == 0 )  {    time_t nCurrentTime = GetCurrentTime();    fFPS = 100 / (nCurrentTime - nLastTime)    nLastTime = nCurrentTime;  }};Illco   