I hacked a following code:
unsigned long long get_cc_time () volatile { uint64 ret; __asm__ __volatile__('rdtsc' : '=A' (ret) : :); return ret; }
It works on g++ but not on Visual Studio. How can I port it ? What are the right macros to detect VS / g++ ?
My inline assembler skills are rusty, but it works like:
But to just use rdtsc you can just use intrinsics:
http://msdn.microsoft.com/en-us/library/twchhe95.aspx