SDL_Time(3type)

πŸ’– NAME πŸ’–

okay bestie, gather round, because SDL_Time is literally the moment. it's from the SDL3 DATATYPES lineup, and here's the whole vibe: an SDL_Time is a signed, 64-bit integer that counts nanoseconds since the Unix epoch β€” and the Unix epoch is Jan 1, 1970, iykyk. that's it. that's the girl. πŸ•°οΈβœ¨


✨ SYNOPSIS ✨

#include <SDL3/SDL_stdinc.h>

typedef Sint64 SDL_Time;
#define SDL_MAX_TIME SDL_MAX_SINT64
#define SDL_MIN_TIME SDL_MIN_SINT64

like, look at her. typedef Sint64 SDL_Time; β€” an icon, a legend, a 64-bit signed situation. and she brought friends: SDL_MAX_TIME is literally just SDL_MAX_SINT64, and SDL_MIN_TIME is SDL_MIN_SINT64. no cap, those are the exact definitions, don't let anyone tell you otherwise πŸ’…


🌸 DESCRIPTION 🌸

so here's the tea, bestie. SDL_Time does not live in her own little bubble β€” she's a social butterfly and she converts. πŸ¦‹

  • wanna go between SDL_Time and POSIX time_t values? use SDL_NS_TO_SECONDS() and SDL_SECONDS_TO_NS(). one goes one way, one goes the other, and they ate. πŸ”₯
  • wanna go between SDL_Time and Windows FILETIME values? that's SDL_TimeToWindows() and SDL_TimeFromWindows(), and yes they're giving exactly what you think they're giving. ✨

that's the entire description, and honestly? obsessed. short, sweet, main character energy. πŸ‘‘


πŸŽ€ AVAILABILITY πŸŽ€

this datatype said "let me make an entrance" and arrived in SDL 3.2.0. so if you're on anything older, bestie... it's not there. πŸ™ˆ


🌈 SEE ALSO 🌈

  • SDL_MAX_SINT64(3) β€” the big number energy πŸ’œ
  • SDL_MIN_SINT64(3) β€” the tiny number energy πŸ“

and that's the whole page, bestie!! slay 🫢 this was brought to you by Simple Directmedia Layer, SDL 3.4.18, and this very SDL_Time(3type) moment β€” go forth and count your nanoseconds, you gorgeous genius, periodt πŸ’–πŸŽ€βœ¨

πŸ“¦ where this page comes from