10 QueryPerformanceCounter(&t);
12 #elif defined(__x86_64__) || defined(__amd64__) 14 __asm__ __volatile__(
"rdtsc" :
"=a" (l),
"=d" (h));
15 return (
unsigned long long)h<<32|l;
16 #elif defined(__i386__) 18 __asm__
volatile (
"rdtsc" :
"=A" (ret) );
20 #elif defined(__ARM_ARCH_7A__) 22 asm volatile(
"mrc p15, 0, %0, c9, c13, 0" :
"=r"(r) );
24 #elif defined(__AARCH64EL__) 26 asm volatile(
"mrs %0, pmccntr_el0" :
"=r"(
b) ::
"memory" );
35 static double freq = -1;
36 if (freq != -1)
return freq;
39 QueryPerformanceFrequency(&li);
40 freq = (double)li.QuadPart;
41 #elif defined(__QNX__)
42 freq = SYSPAGE_ENTRY( qtime )->cycles_per_sec;
43 #elif defined(__APPLE__) 47 std::ifstream
ifs(
"/proc/cpuinfo");
49 std::cerr <<
"failed to open /proc/cpuinfo" << std::endl;
unsigned long long tick_t
RTC::ReturnCode_t ret(RTC::Local::ReturnCode_t r)
double get_cpu_frequency()