From f52aa3d04176c0b0aff8a4b5abd477eb7aa7ea5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Lam?= Date: Sat, 13 Feb 2021 18:24:23 +0100 Subject: [PATCH] HW: Add a UDL for timebase ticks to cycles conversions --- Source/Core/Core/HW/SystemTimers.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Source/Core/Core/HW/SystemTimers.h b/Source/Core/Core/HW/SystemTimers.h index 8340047b72..258520ad44 100644 --- a/Source/Core/Core/HW/SystemTimers.h +++ b/Source/Core/Core/HW/SystemTimers.h @@ -63,3 +63,12 @@ s64 GetLocalTimeRTCOffset(); double GetEstimatedEmulationPerformance(); } // namespace SystemTimers + +inline namespace SystemTimersLiterals +{ +/// Converts timebase ticks to clock ticks. +constexpr u64 operator""_tbticks(unsigned long long value) +{ + return value * SystemTimers::TIMER_RATIO; +} +} // namespace SystemTimersLiterals