mirror of
https://github.com/luanti-org/luanti.git
synced 2025-11-30 04:35:20 +01:00
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.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user