Search code examples
frame-rate

estimating the frame rate


I'm developing an slightly animated application (in c++ with opengl). For that, I need to know the framerate the system is capable of. What I now do is calculate the framerate for the last display-action and then average that with the history. This works slightly: the average rate is still rather jumpy. This problem must have been solved at least once (e.g. file copy progress dialogs), so I was thinking: would it be helpfull to apply a low pass filter? What values should I use then? My guess is that I should remove all frequencies above 60Hz or so? (my monitor refreshes at 60Hz rate)


Solution

  • it's weird that the average frame rate is jumpy, unless you disabled vsync (okay, i guess you did, since you get frequencies above your refresh rate in the first place ;))

    just a hunch: maybe you should get the second quartile (= the median) of the history over x frames (experiment with x ;)) instead of the average :)