Professional Documents
Culture Documents
3 Want to improve this question? Update the question so it can be answered with facts and citations by
editing this post.
Closed 7 months ago.
What would be the best way to measure the frame rate of my OpenGL program?
opengl frame-rate
Stick a timer at the start of your main loop and test how long it takes to get back there.
__int64 frequency;
QueryPerformanceFrequency( (LARGE_INTEGER*)&frequency );
Measure the elapsed time and count the number of frames. Divide one by the other to give frame rate.
3
https://stackoverflow.com/questions/1370361/opengl-frame-rate 1/2
4/7/24, 4:14 PM OpenGl Frame rate - Stack Overflow
When the elapsed time reached one second, or more if you want to average it over a longer time period
reset both counts and start again.
If I am using glut and I make this call glutIdleFunc(oneFrame); I am assuming that the oneFrame will be called
every frame is this correct? – Mike2012 Sep 2, 2009 at 22:30
I believe so but I'm not that familiar with glut – jcoder Sep 3, 2009 at 7:25
http://www.fraps.com/
-1
Share Improve this answer Follow answered Sep 22, 2011 at 15:33
seveland
179 12
https://stackoverflow.com/questions/1370361/opengl-frame-rate 2/2