const float FPS = 60;
timer = al_create_timer(1.0 / FPS);
Apparently, those two lines start a timer that goes off 60 times per second.
I don’t understand that. 1/FPS gives 1/60, and docs say the parameter of al_create_timer is the number of seconds it counts per tick, so it counts 1/60 of a second per tick. So…is that to say the timer conveniently ticks 60 times per second? I’m not understanding these units.
The units are seconds. If you want it to go off 60 times per second, then the timer lasts 1/60th of a second. If you want it to go off 5 times per second, then you would set the length between timer firings to be 1/5 of a second.
Think of setting the time interval of the timer rather than the number of times per second (or frequency) of the timer.