Have you considered to use an RDTSC timer for intel platforms? The code is in some ways more portable than times(). For win32 _int64 t; #define RDTSC_TIMER(x) {__asm rdtsc __asm mov DWORD PTR [x],EAX __asm mov DWORD PTR [x+4],EDX} RDTSC_TIMER(t) DB