Getting Framerate - Programmers Heaven

Howdy, Stranger!

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


Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Getting Framerate

PhreakPhreak Posts: 54Member
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


  • Sand_Hawk9Sand_Hawk9 Posts: 233Member
    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.