[Base] Clock reworked.

- Time progression is now equal and in sync on all threads.
- Floating point imprecisions do not interfere with timing.
This commit is contained in:
Joel Linn
2019-11-20 00:28:08 +01:00
committed by Rick Gibbed
parent 6a3a56b3b9
commit d6ce72ddc9
3 changed files with 121 additions and 44 deletions

View File

@@ -2,7 +2,7 @@
******************************************************************************
* Xenia : Xbox 360 Emulator Research Project *
******************************************************************************
* Copyright 2015 Ben Vanik. All rights reserved. *
* Copyright 2019 Ben Vanik. All rights reserved. *
* Released under the BSD license - see LICENSE in the root for more details. *
******************************************************************************
*/
@@ -14,10 +14,8 @@
namespace xe {
uint64_t Clock::host_tick_frequency() {
static LARGE_INTEGER frequency = {{0}};
if (!frequency.QuadPart) {
QueryPerformanceFrequency(&frequency);
}
LARGE_INTEGER frequency;
QueryPerformanceFrequency(&frequency);
return frequency.QuadPart;
}