changeset 370:de3dc287f939 libavutil

* Making [START|STOP]_TIMER work on architectures that support gethrtime()
author romansh
date Thu, 09 Aug 2007 00:12:40 +0000
parents 2cd0add8ac0c
children 30e766822b5a
files common.h
diffstat 1 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/common.h	Thu Jul 19 06:36:02 2007 +0000
+++ b/common.h	Thu Aug 09 00:12:40 2007 +0000
@@ -268,6 +268,7 @@
     }
 
 #if defined(ARCH_X86) || defined(ARCH_POWERPC) || defined(ARCH_BFIN)
+#define AV_READ_TIME read_time
 #if defined(ARCH_X86_64)
 static inline uint64_t read_time(void)
 {
@@ -319,13 +320,17 @@
      return (((uint64_t)tbu)<<32) | (uint64_t)tbl;
 }
 #endif
+#elif defined(HAVE_GETHRTIME)
+#define AV_READ_TIME gethrtime
+#endif
 
+#ifdef AV_READ_TIME
 #define START_TIMER \
 uint64_t tend;\
-uint64_t tstart= read_time();\
+uint64_t tstart= AV_READ_TIME();\
 
 #define STOP_TIMER(id) \
-tend= read_time();\
+tend= AV_READ_TIME();\
 {\
   static uint64_t tsum=0;\
   static int tcount=0;\