mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-10-27 20:58:22 +00:00
12 lines
231 B
C
12 lines
231 B
C
#ifndef _TSC_H
|
|
#define _TSC_H
|
|
|
|
static inline uint64_t rdtsc_serialized(void) {
|
|
uint32_t high;
|
|
uint32_t low;
|
|
asm volatile("cpuid; rdtsc;" : "=a"(low), "=d"(high) : : "rbx", "rcx");
|
|
return ((uint64_t)high << 32) | low;
|
|
}
|
|
|
|
#endif
|