A Simple GLFW FPS Counter

Update – September 2013: Need something that enforces a given frame rate rather than just reports the current frame rate? Try this: http://r3dux.org/2012/12/fpsmanager-a-c-helper-class-for-framerate-independent-movement/


I’m fed up of solving the same problem over and over again, so the next time I need some FPS measurements, I’m going to use this…

The Include Requirements

The Function

Usage Examples

Call any of these in your main loop…

Suggestions?

I think that’s pretty usable and clean – if you’ve got any suggestions I’d really be interested in hearing them – I simply don’t want to re-implement a FPS counter in C++ ever again.