SDL_SECONDS_TO_NS(3)
π SDL_SECONDS_TO_NS π
okay bestie so you're in the SDL3 FUNCTIONS part of the manual and this is literally the page for SDL_SECONDS_TO_NS β the little macro that takes your seconds and hands them back to you as nanoseconds. no cap, that's the whole vibe. πβ‘οΈβ¨
π NAME π
SDL_SECONDS_TO_NS β convert seconds to nanoseconds. that's it, that's the job. π
β¨ SYNOPSIS β¨
#include <SDL3/SDL_timer.h>
#define SDL_SECONDS_TO_NS(S) (((Uint64)(S)) * SDL_NS_PER_SECOND)
one include, one macro, zero drama. π¦
πΈ DESCRIPTION πΈ
okay so here's the tea: this macro converts seconds into nanoseconds, and that's giving very straightforward.
but bestie, listen β it only converts whole numbers, not fractional seconds. so if you were hoping to sneak a 0.5 in there and have it do something cute, nope. whole numbers only. periodt. π«Ά
π§ MACRO PARAMETERS π§
Sβ the number of seconds to convert. hand it over, it'll do the math. π₯
π RETURN VALUE π
Returns S, expressed in nanoseconds. so like, same number, different unit, main character energy. β¨
π THREAD SAFETY π
It is safe to call this macro from any thread. yes fr fr β any thread, any time, no anxiety, no vibe check required. ππ«Ά
π AVAILABILITY π
This macro is available since SDL 3.2.0. so if you're on something older... bestie. upgrade. π
lowkey iconic that a single multiply is carrying this whole page.Uint64cast, timesSDL_NS_PER_SECOND, done. no notes. π β¨
mwah π this has been the SDL_SECONDS_TO_NS page, brought to you by Simple Directmedia Layer β SDL 3.4.18, dated right there in the SDL_SECONDS_TO_NS(3) footer. go forth and multiply (by SDL_NS_PER_SECOND). πΈπ¦
π¦ 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