al_create_timer(3)

πŸ“¦
version 5.2.11.3 Β· 3 versions
, in arch rolling

πŸ’… al_create_timer(3) πŸ’…

okay bestie, this page is from the Library Functions Manual, and it's giving tiny time-baby energy. πŸ•°οΈβœ¨

✨ NAME ✨

al_create_timer β€” the Allegro 5 API call that makes a timer for you, no cap. 🫢

🌸 SYNOPSIS 🌸

#include <allegro5/allegro.h>

ALLEGRO_TIMER *al_create_timer(double speed_secs)

πŸŽ€ DESCRIPTION πŸŽ€

So this function allocates and initializes a timer. If it's successful, you get back a pointer to a new timer object; otherwise it returns NULL. 😭

speed_secs is in seconds per β€œtick”, and it must be positive. No zero, no negative, bestie β€” positive only. πŸ’…

The new timer is initially stopped, and it needs to be started with al_start_timer(3) before ALLEGRO_EVENT_TIMER(3) events are sent. Like, it's literally asleep until you wake it up. ⏰✨

Usage note, iykyk: typical granularity is on the order of microseconds, but with some drivers it might only be milliseconds. So don't come for the timer if it's not pixel-perfect on every driver. πŸ¦‹

πŸ’– SEE ALSO πŸ’–


Signed with sparkle: source/version tag is Allegro reference manual, page tag is al_create_timer(3), and there's no extra date listed on this one β€” fr fr. πŸŒˆπŸ‘‘

πŸ“¦ where this page comes from
  • arch rolling: allegro 5.2.11.3-2 Β· Zlib AND BSD-3-Clause AND OFL-1.1 AND LicenseRef-Custom
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms