From 88ecc59aa3dd28a19196e31ca340417e9371c80e Mon Sep 17 00:00:00 2001 From: twinaphex Date: Mon, 17 Feb 2014 15:58:46 +0100 Subject: [PATCH] (PSP) Implement rarch_get_perf_counter for MIPS with gettimeofday --- performance.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/performance.c b/performance.c index 298c03491c..a9c53c0c97 100644 --- a/performance.c +++ b/performance.c @@ -47,6 +47,10 @@ #define CLOCK_MONOTONIC 2 #endif +#if defined(__mips__) +#include +#endif + #if defined(__PSL1GHT__) #include #elif defined(__CELLOS_LV2__) @@ -164,6 +168,10 @@ retro_perf_tick_t rarch_get_perf_counter(void) asm volatile( "mrc p15, 0, %0, c9, c13, 0" : "=r"(time) ); #elif defined(__CELLOS_LV2__) || defined(GEKKO) || defined(_XBOX360) || defined(__powerpc__) || defined(__ppc__) || defined(__POWERPC__) time = __mftb(); +#elif defined(__mips__) + struct timeval tv; + gettimeofday(&tv, NULL); + return (uint64_t)((tv.tv_sec) * 1000000 + tv.tv_usec); #endif return time;