diff options
| author | Polesznyák Márk <contact@pml68.dev> | 2026-04-06 23:44:45 +0200 |
|---|---|---|
| committer | Polesznyák Márk <contact@pml68.dev> | 2026-04-06 23:44:45 +0200 |
| commit | 6637fdded6f3c5fba7e7a378ca7e30d0db11f27d (patch) | |
| tree | 40f8868ae2140680645b1f90f4a1fc2a378920b3 /vendor/hare-sdl2/sdl2/timer.ha | |
| parent | docs: add README (diff) | |
| parent | Add ! after c::fromstr calls to handle nomem (diff) | |
| download | hare-chip8-6637fdded6f3c5fba7e7a378ca7e30d0db11f27d.tar.gz | |
Add 'vendor/hare-sdl2/' from commit 'fb6008be0b79a2a24b1ac960316a83f7873b4f39'
git-subtree-dir: vendor/hare-sdl2
git-subtree-mainline: ed088aa81ac23fa48d5ae48ee739c97e0fcb4490
git-subtree-split: fb6008be0b79a2a24b1ac960316a83f7873b4f39
Diffstat (limited to '')
| -rw-r--r-- | vendor/hare-sdl2/sdl2/timer.ha | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/vendor/hare-sdl2/sdl2/timer.ha b/vendor/hare-sdl2/sdl2/timer.ha new file mode 100644 index 0000000..d90511a --- /dev/null +++ b/vendor/hare-sdl2/sdl2/timer.ha @@ -0,0 +1,32 @@ +// Get the number of milliseconds since SDL library initialization. +// +// This value wraps if the program runs for more than ~49 days. +// +// Returns an unsigned 32-bit value representing the number of milliseconds +// since the SDL library initialized. +export @symbol("SDL_GetTicks") fn SDL_GetTicks() u32; + +// Get the current value of the high resolution counter. +// +// This function is typically used for profiling. +// +// The counter values are only meaningful relative to each other. Differences +// between values can be converted to times by using +// [[SDL_GetPerformanceFrequency]]. +// +// Returns the current counter value. +export @symbol("SDL_GetPerformanceCounter") fn SDL_GetPerformanceCounter() u64; + +// Get the count per second of the high resolution counter. +// +// Returns a platform-specific count per second. +export @symbol("SDL_GetPerformanceFrequency") fn SDL_GetPerformanceFrequency() u64; + +// Wait a specified number of milliseconds before returning. +// +// This function waits a specified number of milliseconds before returning. It +// waits at least the specified time, but possibly longer due to OS +// scheduling. +export @symbol("SDL_Delay") fn SDL_Delay(ms: u32) void; + +// TODO: Timers |
