From 71d38d890bb30ed59c0df45096dbfcf5ab947f4e Mon Sep 17 00:00:00 2001 From: zilmar Date: Fri, 12 Aug 2016 23:49:53 +1000 Subject: [PATCH] [Android] Get profile class to use clock_gettime on non win32 systems --- Source/Project64-core/N64System/ProfilingClass.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Source/Project64-core/N64System/ProfilingClass.cpp b/Source/Project64-core/N64System/ProfilingClass.cpp index 09f21d849..f86f34487 100644 --- a/Source/Project64-core/N64System/ProfilingClass.cpp +++ b/Source/Project64-core/N64System/ProfilingClass.cpp @@ -41,6 +41,10 @@ SPECIAL_TIMERS CProfiling::StartTimer(SPECIAL_TIMERS Address) } m_StartTimeHi = HiValue; m_StartTimeLo = LoValue; +#elif !defined(_WIN32) + struct timespec now; + clock_gettime(CLOCK_MONOTONIC, &now); + m_StartTimeLo = (now.tv_sec * 1000) + (now.tv_nsec / 1000000); #else g_Notify->BreakPoint(__FILE__, __LINE__); #endif @@ -61,6 +65,10 @@ SPECIAL_TIMERS CProfiling::StopTimer() mov LoValue, eax; popad; } +#elif !defined(_WIN32) + struct timespec now; + clock_gettime(CLOCK_MONOTONIC, &now); + LoValue = (now.tv_sec * 1000) + (now.tv_nsec / 1000000); #else g_Notify->BreakPoint(__FILE__, __LINE__); #endif