al_get_time(3alleg5)

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

πŸ’– 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