Thanks guys for your help, Ive got it working now.
This is what it should have been...
This is what it should have been...
//---- file: cpuspeed.c ---- #include <windows.h> unsigned __int64 start, stop; unsigned __int64 nCtr, nFreq, nCtrStop; int CpuSpeed(void) { QueryPerformanceFrequency((LARGE_INTEGER *)&nFreq); __asm__(".byte 0x0F"); __asm__(".byte 0x31"); __asm__("mov %eax,_start"); __asm__("mov %edx,4+(_start)"); QueryPerformanceCounter((LARGE_INTEGER *)&nCtrStop); nCtrStop += nFreq; do { QueryPerformanceCounter((LARGE_INTEGER *)&nCtr); } while (nCtr < nCtrStop); __asm__(".byte 0x0F"); __asm__(".byte 0x31"); __asm__("mov %eax,_stop"); __asm__("mov %edx,4+(_stop)"); return ((stop-start)/1000000); }