lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hi,

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)

Or, you can use QueryPerformanceCounter, if you don't like __asm.  If
you don't need that much precision, you can also use
GetSystemTimeAsFileTime.

[]s,
Diego.