From b662a4577d692329b9ca83525e6039f2ddcd1ac1 Mon Sep 17 00:00:00 2001 From: ShadowNinja Date: Sun, 6 Mar 2016 14:31:16 -0500 Subject: 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. --- src/porting.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/porting.cpp') 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 -- cgit v1.2.3