aboutsummaryrefslogtreecommitdiff
path: root/frontend
diff options
context:
space:
mode:
authornotaz2012-11-18 01:39:24 +0200
committernotaz2012-11-18 01:40:04 +0200
commita2d91a5d28651b7cfa6d411208da5f86bc168dfe (patch)
tree7009d8141c842635b64f806341890e11f86f3b2f /frontend
parentc9099d020a1e523d97541f426f7d44da1392526f (diff)
downloadpcsx_rearmed-a2d91a5d28651b7cfa6d411208da5f86bc168dfe.tar.gz
pcsx_rearmed-a2d91a5d28651b7cfa6d411208da5f86bc168dfe.tar.bz2
pcsx_rearmed-a2d91a5d28651b7cfa6d411208da5f86bc168dfe.zip
frontend: pcnt: use gettimeofday
better than nothing
Diffstat (limited to 'frontend')
-rw-r--r--frontend/pcnt.h17
1 files changed, 15 insertions, 2 deletions
diff --git a/frontend/pcnt.h b/frontend/pcnt.h
index 0213ca1..545f0c4 100644
--- a/frontend/pcnt.h
+++ b/frontend/pcnt.h
@@ -11,6 +11,13 @@ enum pcounters {
#ifdef PCNT
+#ifndef __ARM_ARCH_7A__
+#include <sys/time.h>
+#define PCNT_DIV 1
+#else
+#define PCNT_DIV 1000
+#endif
+
static const char *pcnt_names[PCNT_CNT] = { "", "gpu", "spu", "blit", "gte", "test" };
#define PCNT_FRAMES 10
@@ -33,7 +40,7 @@ static inline void pcnt_print(float fps)
int i;
for (i = 0; i < PCNT_CNT; i++)
- pcounters[i] /= 1000 * PCNT_FRAMES;
+ pcounters[i] /= PCNT_DIV * PCNT_FRAMES;
rem = total = pcounters[PCNT_ALL];
for (i = 1; i < PCNT_CNT; i++)
@@ -79,7 +86,13 @@ static inline unsigned int pcnt_get(void)
__asm__ volatile("mrc p15, 0, %0, c9, c13, 0"
: "=r"(val));
#else
- val = 0;
+ // all slow on ARM :(
+ //struct timespec tv;
+ //clock_gettime(CLOCK_MONOTONIC_RAW, &tv);
+ //val = tv.tv_sec * 1000000000 + tv.tv_nsec;
+ struct timeval tv;
+ gettimeofday(&tv, NULL);
+ val = tv.tv_sec * 1000000 + tv.tv_usec;
#endif
return val;
}