From ba956da9578668a16c5a3ee401060a358c2503ac Mon Sep 17 00:00:00 2001 From: RD42 <42702181+dashr9230@users.noreply.github.com> Date: Fri, 17 Nov 2023 23:25:37 +0800 Subject: [PATCH] [server] Add timeBeginPeriod --- server/main.cpp | 1 + server/main.h | 1 + server/server.vcproj | 2 ++ 3 files changed, 4 insertions(+) diff --git a/server/main.cpp b/server/main.cpp index f4b6609..76d8387 100644 --- a/server/main.cpp +++ b/server/main.cpp @@ -290,6 +290,7 @@ int main (int argc, char** argv) // Setup the exception handler on windows SetUnhandledExceptionFilter(exc_handler); + timeBeginPeriod(1); // increases the accuracy of Sleep() #endif // Load up the plugins diff --git a/server/main.h b/server/main.h index 62791dd..b5d98e6 100644 --- a/server/main.h +++ b/server/main.h @@ -22,6 +22,7 @@ #define SLEEP(x) { Sleep(x); } #include + #include #include #else #define SLEEP(x) { usleep(x * 1000); } diff --git a/server/server.vcproj b/server/server.vcproj index 250a211..fa748f5 100644 --- a/server/server.vcproj +++ b/server/server.vcproj @@ -31,6 +31,7 @@ Name="VCCustomBuildTool"/>