SDL_GetTicksNS(3)

πŸ’– SDL_GetTicksNS(3) πŸ’–

okay so bestie, this is a page from the SDL3 FUNCTIONS manual, and today's main character is SDL_GetTicksNS β€” she counts nanoseconds since SDL woke up. yes, nanoseconds. we're doing precision today. πŸ¦‹


✨ NAME ✨

SDL_GetTicksNS β€” get the number of nanoseconds since SDL library initialization.

like, since the moment SDL got its life together and initialized. that's your zero point. periodt. πŸ‘‘


🌸 SYNOPSIS 🌸

#include <SDL3/SDL_timer.h>

Uint64 SDL_GetTicksNS(void);

she takes no arguments. zero. void. she doesn't want your input, she just wants to tell you the time. πŸ’…


πŸŽ€ RETURN VALUE πŸŽ€

She hands you back an unsigned 64-bit value β€” that's a Uint64 β€” and it represents the number of nanoseconds since the SDL library initialized.

no cap, that's the whole vibe. one number, big number, very tiny unit. πŸ•°οΈβœ¨


🫢 THREAD SAFETY 🫢

It is safe to call this function from any thread. literally any of them. bring your whole group chat, everyone can call it, nobody's gonna fight. 😌🌈


⭐ AVAILABILITY ⭐

This function has been available since SDL 3.2.0. so if you're on something older than that… bestie. it's giving ancient. upgrade. πŸ™ˆ


fr fr, if you need a timestamp and you need it precise, this is your girl. she's been counting since initialization and she has not missed a single nanosecond. obsessed. πŸ’œ

that's the whole page, bestie β€” mwah, go time something. πŸ’–

signed off from Simple Directmedia Layer, SDL 3.4.18 β€” this is the SDL_GetTicksNS(3) era and we are living in it. πŸŽ€βœ¨

πŸ“¦ where this page comes from