From 837d872bcdf809c88925e5e07bc4590ddf5e6510 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Tue, 3 Jun 2025 18:01:59 +0800 Subject: Simple usleep implementation for Windows Just copying from this site and adjusting it for now: https://filipivianna.blogspot.com/2010/07/usleep-on-windows-win32.html --- indra/newview/llappviewer.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 7580100977..e1e26372df 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1544,7 +1544,15 @@ bool LLAppViewer::doFrame() if(fpsLimitSleepFor) { +#if LL_WINDOWS + U64 time1 = 0, time2 = 0; + QueryPerformanceCounter((LARGE_INTEGER *)&time1); + do { + QueryPerformanceCounter((LARGE_INTEGER *)&time2); + } while ((time2-time1) < fpsLimitSleepFor); +#else usleep(fpsLimitSleepFor); +#endif } // yield some time to the os based on command line option -- cgit v1.2.3