[SDL] best way to calculate framerate per second
Tommy Hinks
tommy.hinks at gmail.com
Wed Apr 25 09:40:52 PDT 2007
The second way is preferable. The reason it is more stable is because
it is an average over a whole second.
Tommy
On 25/04/07, C. Alvarez <blubzouf at gmail.com> wrote:
> I was wondering how to exactly calculte the framerate of and
> SDL/OpenGL application with vsync ( 75Hz ) activated.
>
>
> * I the first way, with a basic
>
> FPS = 1000 / lastframeduration
>
> I get a variable 71 to 76 fps count.
>
> * In a second way, I increment a counter after each frame, and when
> one second a time is ended, I do a FPS = fpscounter and I reset
> fpscounter to zero for next second, and I get a very constant 75 to
> 76 fps count.
>
> The second wy seems to be more accurate, but is this a good way to
> count each second the frame's quantity ?
> _______________________________________________
> SDL mailing list
> SDL at lists.libsdl.org
> http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
>
More information about the SDL
mailing list