Getting Framerate

Im using open GL to write a game and i want to look at my fps, so i figured I would start a variable, and add 1 to it for each time it printed a frame to a screen, then divide that by then number of seconds that had passed, and reset it every couple seconds to keep it accurate, but i dont know how to get the time or the seconds so i dont know how to do this... also if there is a better way it would be very appreciated


  • Well, getting the time is very easy. Just look in the help file of you're compiler and will find it. It should be something like Gettime or something like that. But the standard routine is mostly also the slowest so the best thing you can do is find somewhere a very fast routine in ASM or inline. Hope it helped.

    Sand Hawk

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


In this Discussion