al_add_timer_count(3alleg5)
β¨ al_add_timer_count β¨
okay bestie, welcome to the Allegro 5 API manual page for al_add_timer_count β yes that's the function, yes it's giving main character energy, and yes we're gonna get you fluent in it in like ninety seconds π
πΈ NAME πΈ
al_add_timer_count β literally what it says on the tin, but make it Allegro 5 API π
π¦ SYNOPSIS π¦
#include <allegro5/allegro.h>
void al_add_timer_count(ALLEGRO_TIMER *timer, int64_t diff)
π DESCRIPTION π
So here's the tea: al_add_timer_count adds diff to the timer's counter value. That's it. That's the whole vibe. π
If you were gonna do it the long way, it would look exactly like this:
al_set_timer_count(timer, al_get_timer_count(timer) + diff);
...except β and this is the part where it gets iconic β the addition happens atomically, so no ticks will be lost. periodt. πβ¨
ngl if you do the read-then-write version above by hand in a threaded situation, a tick can slip through the cracks between the get and the set. this function said "not on my watch" π«Ά
π SEE ALSO π
al_set_timer_count(3alleg5)β the sibling, the co-star, the other half of the duo π
that's the whole page bestie, go forth and count those ticks π§πΈ
mwah π β this has been your girl, signing off from the Allegro reference manual, al_add_timer_count(3alleg5), and yes the header says the same thing twice, that's just how manpages are, we don't question it π
π¦ where this page comes from
- debian trixie: allegro5-doc 2:5.2.10.1+dfsg-1 Β· Zlib
- ubuntu questing: allegro5-doc 2:5.2.10.1+dfsg-1build1
- ubuntu resolute: allegro5-doc 2:5.2.11.3+dfsg-1 Β· Zlib
- ubuntu stonking: allegro5-doc 2:5.2.11.3+dfsg-1 Β· Zlib
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms