diff --git a/src/os/windows/win32.cpp b/src/os/windows/win32.cpp --- a/src/os/windows/win32.cpp +++ b/src/os/windows/win32.cpp @@ -18,6 +18,7 @@ #define NO_SHOBJIDL_SORTDIRECTION // Avoid multiple definition of SORT_ASCENDING #include /* SHGetFolderPath */ #include +#include #include "win32.h" #include "../../fios.h" #include "../../core/alloc_func.hpp" @@ -413,6 +414,9 @@ int APIENTRY WinMain(HINSTANCE hInstance int argc; char *argv[64]; // max 64 command line arguments + /* Set system timer resolution to 1ms. */ + timeBeginPeriod(1); + CrashLog::InitialiseCrashLog(); #if defined(UNICODE) @@ -440,6 +444,10 @@ int APIENTRY WinMain(HINSTANCE hInstance for (int i = 0; i < argc; i++) ValidateString(argv[i]); openttd_main(argc, argv); + + /* Restore system timer resolution. */ + timeEndPeriod(1); + free(cmdline); return 0; }