summaryrefslogtreecommitdiff
path: root/src/porting.cpp
diff options
context:
space:
mode:
authorShadowNinja <shadowninja@minetest.net>2016-03-06 14:31:16 -0500
committerShadowNinja <shadowninja@minetest.net>2017-04-28 14:43:18 -0400
commitb662a4577d692329b9ca83525e6039f2ddcd1ac1 (patch)
treed1f59d395f47320149560bef4278dc0e6a194473 /src/porting.cpp
parent7f4cdbcbe9b5b4655c2c5eba2043628487668e24 (diff)
downloadminetest-b662a4577d692329b9ca83525e6039f2ddcd1ac1.tar.gz
minetest-b662a4577d692329b9ca83525e6039f2ddcd1ac1.tar.bz2
minetest-b662a4577d692329b9ca83525e6039f2ddcd1ac1.zip
Clean up getTime helpers
This increases size of the getTime return values to 64 bits. It also removes the TimeGetter classes since the getTime functions are now very precise.
Diffstat (limited to 'src/porting.cpp')
-rw-r--r--src/porting.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/porting.cpp b/src/porting.cpp
index 8c92a3cba..10b6fc940 100644
--- a/src/porting.cpp
+++ b/src/porting.cpp
@@ -942,5 +942,18 @@ void attachOrCreateConsole(void)
#endif
}
+// Load performance counter frequency only once at startup
+#ifdef _WIN32
+
+inline double get_perf_freq()
+{
+ LARGE_INTEGER freq;
+ QueryPerformanceFrequency(&freq);
+ return freq.QuadPart;
+}
+
+double perf_freq = get_perf_freq();
+
+#endif
} //namespace porting