Frames per second counter

Hi,

Ive made a landscape generator and want to be be able to see how many frames per second it’s running at. Does anyone know of any good programs that can do this?

thanks

Write some font code, and display it yourself.

Very easy to do. Get some high precision timers (in win32 api) and time each frame.

then fps is merely 1.0f / frame time.

then just render it.

sorted.

Nutty

// gets the time

static float gettime(void)
{
float tnew,ris;
static float told=0.0f;

tnew=glutGet(GLUT_ELAPSED_TIME);
ris=tnew-told;
told=tnew;
return ris/1000.0;
}
// you hav a variable FPS, with some value:

#define FRAME 50
// and then you can call in your main render
// function:

if((framecount % FRAME)==0)
{
fr=gettime();
}
framecount++;
// now FRAME/fr is your FPS.
// it gets updates every 50 frames.

Hi,
http://slug-production.ibelgique.com

Download Section

There’s a example who display the FPS on the screen.