Version
2.0 - September 6, 2003
 
Description
A simple class to track FPS (frames per second). It tracks minimum, maximum and average FPS. It can create a Game Gauge 2.0 style log file, or you can poll it to see the current stats. It's completely API independant, so you can use it with any version of DirectX, or even OpenGL.
 
Example Use
First the declaration:
dhFPSTimer g_timer("My App Name");
When you're ready to start timing:
g_timer.StartTimer();
After you Present/Flip, you also have to call dhFPSTimer's Present:
g_d3d_device->Present(NULL,NULL,NULL,NULL);
g_timer.Present();

To create a log file with the current stats:
g_timer.LogTimer(); //Saves info to FPS.txt
or
g_time.LogTimer("MyFileName.txt");
You can poll the current stats, this is useful if you want to display the FPS on screen:
float fps;
DWORD min_fps;
DWORD max_fps;

g_timer.CheckTimer(&fps,&min_fps,&max_fps);

 
Download