summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErik Kundiman <erik@megapahit.org>2025-06-03 18:01:59 +0800
committerErik Kundiman <erik@megapahit.org>2025-06-03 18:01:59 +0800
commit837d872bcdf809c88925e5e07bc4590ddf5e6510 (patch)
tree22ecbee932c04bca26df598500129e15a5a1d28d
parentbefce1b8547d7dadb692b9246339433dca869a45 (diff)
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
-rw-r--r--indra/newview/llappviewer.cpp8
1 files changed, 8 insertions, 0 deletions
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