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
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms