summaryrefslogtreecommitdiff
path: root/src/os/windows/win32.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/os/windows/win32.cpp')
-rw-r--r--src/os/windows/win32.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/os/windows/win32.cpp b/src/os/windows/win32.cpp
index 6576ea20d..8783b3762 100644
--- 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 <shlobj.h> /* SHGetFolderPath */
#include <shellapi.h>
+#include <timeapi.h>
#include "win32.h"
#include "../../fios.h"
#include "../../core/alloc_func.hpp"
@@ -413,6 +414,9 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLi
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, HINSTANCE hPrevInstance, LPSTR lpCmdLi
for (int i = 0; i < argc; i++) ValidateString(argv[i]);
openttd_main(argc, argv);
+
+ /* Restore system timer resolution. */
+ timeEndPeriod(1);
+
free(cmdline);
return 0;
}