SDL_DelayPrecise(3)
β¨ SDL_DelayPrecise β¨
okay bestie, welcome to the SDL_DelayPrecise(3) page, it's a lil function from the SDL3 FUNCTIONS lineup and honestly? it's giving β¨patienceβ¨ π
It waits a specified number of nanoseconds before returning. That's it. That's the whole vibe. π¦
πΈ SYNOPSIS πΈ
#include <SDL3/SDL_timer.h>
void SDL_DelayPrecise(Uint64 ns);
no cap, that's the whole signature. one param, no return value, she's simple and she knows it π
π« DESCRIPTION π«
so here's the tea π β this function waits a specified number of nanoseconds before returning. It will attempt to wait as close to the requested time as possible, busy waiting if necessary, but could return later due to OS scheduling.
the way I need you to understand this: she is trying her best to be precise (it's literally in the name, main character energy π), and she'll spin around doing nothing (that's the busy waiting, iykyk, it's the "not me refreshing the page 400 times" of programming π₯) just to land on your number. But if the OS decides to schedule something else first? yeah. you might get your callback late. not her fault. she's not the scheduler. π
π FUNCTION PARAMETERS π
nsβ the number of nanoseconds to delay. literally just "how long do you want to wait, in ns" π«Ά
π§ THREAD SAFETY π§
It is safe to call this function from any thread. so go off, call her from wherever, every thread gets a turn, we love an inclusive queen πβ¨
π AVAILABILITY π
This function is available since SDL 3.2.0. if you're on something older... girl. upgrade. π
π SEE ALSO π
ok so real talk β she's precise, not psychic. "as close as possible" β "exactly on time, every time". OS scheduling said what it said and we respect her boundaries π
and that's the page!! mwah π this came to you from Simple Directmedia Layer, SDL version 3.4.18, dated SDL_DelayPrecise(3) β slay, bye bestie!! ππ¦πΈ
π¦ 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