From 21bc2c14bc7408427a8b4851a7a3f15251f2afa8 Mon Sep 17 00:00:00 2001 From: Liam Date: Sun, 8 Oct 2023 11:32:32 -0400 Subject: common: add arm64 native clock --- src/common/wall_clock.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/common/wall_clock.cpp') diff --git a/src/common/wall_clock.cpp b/src/common/wall_clock.cpp index 71e15ab4c..caca9a123 100644 --- a/src/common/wall_clock.cpp +++ b/src/common/wall_clock.cpp @@ -10,6 +10,10 @@ #include "common/x64/rdtsc.h" #endif +#if defined(ARCHITECTURE_arm64) && defined(__linux__) +#include "common/arm64/native_clock.h" +#endif + namespace Common { class StandardWallClock final : public WallClock { @@ -53,7 +57,7 @@ private: }; std::unique_ptr CreateOptimalClock() { -#ifdef ARCHITECTURE_x86_64 +#if defined(ARCHITECTURE_x86_64) const auto& caps = GetCPUCaps(); if (caps.invariant_tsc && caps.tsc_frequency >= std::nano::den) { @@ -64,6 +68,8 @@ std::unique_ptr CreateOptimalClock() { // - Is not more precise than 1 GHz (1ns resolution) return std::make_unique(); } +#elif defined(ARCHITECTURE_arm64) && defined(__linux__) + return std::make_unique(); #else return std::make_unique(); #endif -- cgit v1.2.3