diff options
author | Erik Kundiman <erik@megapahit.org> | 2025-06-03 18:01:59 +0800 |
---|---|---|
committer | Erik Kundiman <erik@megapahit.org> | 2025-06-03 18:01:59 +0800 |
commit | 837d872bcdf809c88925e5e07bc4590ddf5e6510 (patch) | |
tree | 22ecbee932c04bca26df598500129e15a5a1d28d | |
parent | befce1b8547d7dadb692b9246339433dca869a45 (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.cpp | 8 |
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 |