in Allegro 4 a FPS counter could be implemented as in http://wiki.allegro.cc/index.php?title=Timers:
In Allegro 5 a simple mouse input program could look like the following (from http://wiki.allegro.cc/index.php?title=Allegro_5_Tutorial/Input):
How could I efficiently measure the FPS and display this to the screen in Allegro 5?
Same approach will work. Allegro 5 comes with a much better way to measure current time (game time in that example), al_get_time, so using a separate game timer is not necessary.
So the code would roughly be:
There are probably 100 other ways to do it, though... I think pretty much every example that comes with A5 that displays FPS uses a different method of calculating it.
That was perfect.
Thank you.