al_add_timer_count(3alleg5)

πŸ“¦
version 5.2.11.3 Β· 4 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

✨ 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 πŸ‘‘


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