Quantcast
Channel: CPU timer in C++ - Stack Overflow
Viewing all articles
Browse latest Browse all 2

CPU timer in C++

$
0
0
unsigned char ticks_bits[3] = { 0x0F, 0x31, 0xC3};__uint64_t ( * ticks ) () = (__uint64_t (*) ()) & ticks_bits;__uint64_t T = ticks(); // CRASH!

I have used this code for many years in Windows-32bit to get CPU ticks.But it will crash in Linux 64bit. Is there a way to make it work?


Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images