al_get_time(3alleg5)
π al_get_time π
okay bestie, so this one is literally the little clock gremlin of the Allegro 5 API πβ¨ β it's al_get_time from the Allegro reference manual, and she is SO simple and SO useful. no cap.
πΈ SYNOPSIS πΈ
#include <allegro5/allegro.h>
double al_get_time(void)
that's it. that's the whole thing. no args, no drama, just a double and a dream π«Ά
β¨ DESCRIPTION β¨
so like, al_get_time hands you back the number of seconds since the Allegro library got initialised. that's it, that's the tea π
β οΈ okay but the important part, bestie: the return value is undefined if Allegro is uninitialised. like, undefined undefined. don't do that. init your library first, i am begging π
and the resolution? it depends on the driver being used. so like, it's giving whatever your driver feels like giving. but typically it can be in the order of microseconds π β which is genuinely iconic, ngl, that's some serious precision for such a tiny function.
π cute sign-off π
this lil masterpiece lives in the Allegro reference manual, filed under al_get_time(3alleg5). go off, timer function, you ate π
πβ
π¦ 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