ReadClock question - Possible overflow?



; RDTSC.ASM Agner Fog
2003

; © 2003 GNU General Public License www.gnu.org/copyleft/gpl.html

PublicAlias _ReadClock ; Underscore needed when called from
Windows

push ebx
sub eax, eax
cpuid ; serialize
rdtsc ; read time stamp counter
push eax
push edx
sub eax, eax
cpuid ; serialize
pop edx
pop eax
pop ebx
ret
ReadClock ENDP

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?

Thank you

yccheok

.



Relevant Pages

  • Re: Macro2D
    ... mov, eax ... cmp eax, -1 ... push STD_INPUT_HANDLE ...
    (alt.lang.asm)
  • Re: Insert a byte
    ... push ebx ... mov ebx, dword ... cmp dword, 0 ... ..e0: xor eax, eax ...
    (alt.lang.asm)
  • ascii to st0
    ... push IDC_ARROW ... cmp eax, 0 ... mov ebp, esp ... cmp dword @Message, WM_CLOSE ...
    (alt.lang.asm)
  • Re: Interesting Web Site on Open Source Development
    ... mov D§esp 0DEADBEEF call Code04013A0 ... call Code0401100 push eax lea eax D§esp+014 push Data0402124 ... push eax call 'USER32.wsprintfA' add esp 0C push 030 lea ecx D§esp+014 push ecx ...
    (alt.lang.asm)
  • Re: Insert a byte
    ... mov, eax ... push STD_INPUT_HANDLE ... mov edx, ...
    (alt.lang.asm)