How can i get current framerate of OpenGL program in SGI computer?..

Here is the code I use.

// Updates frame rate every 5 seconds
case WM_TIMER:
int nFrames;
char cOutBuffer[32];
LARGE_INTEGER currentTime; float fps;
// Get the frame count
nFrames = rsRenderData.uiFrames;

// Get the current Time

fps = (float)(nFrames - nLastFrames)/((float)(currentTime.QuadPart - startTime.QuadPart)/
sprintf(cOutBuffer,"fps %0.1f ",fps);

The above code is for Win32 platforms, and will most certainly not work on SGI computers. But the way to calculate it is still the same. Either calculate the time for any number of frame, or count the number of frames in any given time. fps=<number of frames>/<time in seconds> in both cases.

Can’t post any code since I’m no UNIX programmer.

Check out the thread:

it tells you what man pages to look at to get timing info. (If you need more help, let me know…)


You can get nanosecond resolution on SGI’s with (I beleive) clock_gettime(SGI_REALTIME_CLOCK).

I am not 100% sure this is the name, but it is close.