// The guest vblank's timer (runtime/video/vblank_timer.cpp) on this machine: // how late a thread sleeping to vblanks 16.667 ms apart wakes, as an ordinary // thread and as the Vsync thread prepares itself, alone and with every core // kept busy by threads of the class the game's own busy threads run at (the // command processor, the renderer, audio: user-interactive on macOS). // From the repo root: // clang++ -std=c++20 -O2 -Iruntime tests/vblank_timer_test.cpp runtime/video/vblank_timer.cpp -o build/vblank_timer_test // build/vblank_timer_test [seconds per run, default 3] // Checked on macOS only, where the thread changed (2026-10-12): prepared, it // wakes within 1.5 ms in 99% of vblanks and 0.5 ms at the median, loaded or // not, real-time scheduling granted. The ordinary thread's numbers are // printed beside it (the vblank's until then: 3.2 ms late at the median in // the game, up to 9). #include