From 7e0697305408519a803bffc0235f1d75cb813539 Mon Sep 17 00:00:00 2001 From: Evghenii Gaburov Date: Thu, 16 Apr 2015 11:54:06 +0000 Subject: [PATCH] added rtc() to arm examples as well --- examples/timing.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/examples/timing.h b/examples/timing.h index ccf1a8be..32448cbb 100644 --- a/examples/timing.h +++ b/examples/timing.h @@ -54,6 +54,19 @@ __inline__ uint64_t rdtsc() { return (1000000ull * tv.tv_sec + tv.tv_usec) * 1000ull; } +#include +static inline double rtc(void) +{ + struct timeval Tvalue; + double etime; + struct timezone dummy; + + gettimeofday(&Tvalue,&dummy); + etime = (double) Tvalue.tv_sec + + 1.e-6*((double) Tvalue.tv_usec); + return etime; +} + #else // __arm__ #ifdef WIN32