[Base] Add chrono support

- WinSystemClock is a FILETIME clock without scaling, can convert to
  system_time
- XSystemClock is a FILTETIME clock with scaling applied, can only
  convert to WinSystemClock
This commit is contained in:
Joel Linn
2022-03-09 23:49:16 +01:00
committed by Rick Gibbed
parent 9b4168cce9
commit 23eef94984
5 changed files with 263 additions and 84 deletions

View File

@@ -2,7 +2,7 @@
******************************************************************************
* Xenia : Xbox 360 Emulator Research Project *
******************************************************************************
* Copyright 2019 Ben Vanik. All rights reserved. *
* Copyright 2022 Ben Vanik. All rights reserved. *
* Released under the BSD license - see LICENSE in the root for more details. *
******************************************************************************
*/
@@ -10,6 +10,7 @@
#ifndef XENIA_BASE_CLOCK_H_
#define XENIA_BASE_CLOCK_H_
#include <chrono>
#include <cstdint>
#include "xenia/base/cvar.h"
@@ -24,6 +25,8 @@ DECLARE_bool(clock_source_raw);
namespace xe {
// chrono APIs in xenia/base/chrono.h are preferred
class Clock {
public:
// Host ticks-per-second. Generally QueryHostTickFrequency should be used.