MCPcopy Create free account
hub / github.com/Hamlib/Hamlib / rdtsc

Function rdtsc

lib/precise_time.c:138–150  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

136#include <stdint.h>
137
138static inline uint64_t rdtsc()
139{
140 uint32_t hi, lo;
141 uint64_t hi64, lo64;
142 asm volatile("rdtscp\n"
143 "movl %%edx, %0\n"
144 "movl %%eax, %1\n"
145 "cpuid"
146 : "=r"(hi), "=r"(lo) : : "%rax", "%rbx", "%rcx", "%rdx");
147 hi64 = hi;
148 lo64 = lo;
149 return (hi64 << 32) | lo64;
150}
151
152static uint64_t rdtsc_per_sec = 0;
153static void __attribute__((constructor)) init_rdtsc_per_sec()

Callers 2

init_rdtsc_per_secFunction · 0.85
monotonic_secondsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected