Fix frame limiter on WASM.

This commit is contained in:
Jean-Philip Desjardins 2025-02-10 11:37:50 -05:00
parent 1ebd24b869
commit 15ecb34e85

View file

@ -64,8 +64,8 @@ void CFrameLimiter::EndFrame()
WaitForSingleObject(timer, INFINITE);
CloseHandle(timer);
}
#elif defined(__APPLE__)
//Sleeping for the whole delay on macOS/iOS doesn't provide a good enough resolution
#elif defined(__APPLE__) || defined(__EMSCRIPTEN__)
//Sleeping for the whole delay on some platforms doesn't provide a good enough resolution
auto currentTime = std::chrono::high_resolution_clock::now();
auto targetTime = currentTime + delay;
while(currentTime < targetTime)