From b9b79aeff00b5367c76cb1797707345407354841 Mon Sep 17 00:00:00 2001 From: Twinaphex Date: Sat, 26 Jul 2014 04:35:00 +0200 Subject: [PATCH] (iOS) rarch_get_perf_counter should work properly now --- performance.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/performance.c b/performance.c index 05ce4aed23..61ec4157c3 100644 --- a/performance.c +++ b/performance.c @@ -65,6 +65,7 @@ #ifdef __MACH__ #include #include +#include #endif #ifdef EMSCRIPTEN @@ -139,7 +140,11 @@ void retro_perf_log(void) retro_perf_tick_t rarch_get_perf_counter(void) { retro_perf_tick_t time = 0; -#if defined(__linux__) || defined(__QNX__) +#if defined(__MACH__) && defined(__APPLE__) && defined(IOS) + struct mach_timebase_info convfact; + mach_timebase_info(&convfact); + time = mach_absolute_time(); +#elif defined(__linux__) || defined(__QNX__) struct timespec tv; if (clock_gettime(CLOCK_MONOTONIC, &tv) == 0) time = (retro_perf_tick_t)tv.tv_sec * 1000000000 + (retro_perf_tick_t)tv.tv_nsec;