Re: ReadClock question - Possible overflow?




yancheng.cheok@xxxxxxxxx wrote:

I was wondering when having ReadClock function to perform time
measurement. Is there any posibility that the time stamp counter will
overflow (i.e., edx:eax is alreay holding the maximum value, the next
clock cycle, it will reset to 0), hence giving inaccurate time
measurement result?


Under Windows, you should use QueryPerformanceFrequency and
QueryPerformanceCounter to do clock-frequency dependent time
measurement.

As f0dder points out, RDTSC has problems on laptops and multi-core
CPUs.
Cheers,
Randy Hyde

.