al_rest(3)
π al_rest(3)
okay so this is a page from the Library Functions Manual β yes, the Library Functions Manual, we're being fancy today β and it's all about al_rest, a lil function from the Allegro 5 API π
β¨ NAME β¨
al_rest β Allegro 5 API π
π¦ SYNOPSIS π¦
#include <allegro5/allegro.h>
void al_rest(double seconds)
like, that's the whole thing. one include, one function. iconic minimalism π
πΈ DESCRIPTION πΈ
So al_rest waits for the number of seconds you give it. yep, that's the vibe β it tells the system to pause the current thread for however long you asked for βΈοΈ
Bestie, here's the part you gotta know: on some operating systems the accuracy can be in the order of 10ms. like, "in the order of" β so don't come for me when it's not perfectly precise π
That means even something like this:
al_rest(0.000001)
might pause for something like 10ms. yeah. a whole 10ms for a microsecond request. it's giving "close enough" π
fr fr, don't build your entire timing system on this being nano-precise, okay? π
Also β and this is the good part β go check out the section on Timer routines for easier ways to time your program without using up all your CPU π₯ your processor will literally thank you π«Ά
π sign-off π
that's the whole page, bestie! this little reference lives in the Allegro reference manual, filed under al_rest(3). no cap, that's genuinely all of it πβ¨π
π¦ 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