tmr/src/main.cpp
2023-07-10 23:20:34 +02:00

23 lines
453 B
C++

#ifndef DEBUG
#define DEBUG
#endif
#include <vector>
#include <iostream>
#include "debug.h"
//static inline
uint64_t rdtscp()// uint32_t & aux )
{
uint64_t raxlo,rdxho;
asm volatile ( "cpuid\n" \
//"rdtscp\n" : "=a" (raxlo), "=d" (rdxho), "=c" (aux) : : );
"rdtsc\n" : "=a" (raxlo), "=d" (rdxho));
return (rdxho << 32) + raxlo;
}
int main(int argc, char** argv){
uint64_t test = rdtscp();
log_debugcpp(test);
return 0;
}