// Read Clock Ticks
_int64 readTSC (void)
{
_int64 t;
unsigned int a,b;
unsigned int *c = (unsigned int *)&t
_asm {
_emit 0x0f;
_emit 0x31;
mov a,eax;
mov b,edx;
}
c[0]=a;c[1]=b;
return t;
};
I would state the author of this code snippet, but all i remember is that is is free for all use, i cant remember from where i copy/pasted it...
My main problem is that I need to detect if the machine supports this or not. Can someone point me some code that checks if I can use this?
Is this more precise than QueryPerformanceCounter? Or are the two the same thing?
Out of curiosity, are clock ticks actually clock cycles, as in 20 CTs = 20 nanoseconds for example, or is a clock tick = to a performed instruction, as in 20 clock ticks, i just did 20 instructions?
Thanx [Hugo Ferreira][Positronic Dreams][Colibri 3D Engine][Entropy HL2 MOD][Yann L.][Enginuity]
The most irrefutable evidence that there is intelligent life in the Universe is that they haven''t contacted us!