Code:
LONGLONG l1=0;
PLONGLONG pl1=&l1;
__asm {
push eax ; Save registers we will overwrite (eax, ebx, edx).
push ebx
push edx
_emit 0x0F ; The RDTSC instruction consists of these two bytes.
_emit 0x31
mov ebx, pl1 ; Put the address where the timestamp goes in ebx.
mov [ebx],eax ; Save low 4 bytes of timestamp there.
mov [ebx+4],edx ; Save high 4 bytes of timestamp next.
pop edx ; Restore overwritten registers.
pop ebx
pop eax
}
so hab ichs mal gemacht
EDIT: Wenn du das einmal am Anfang und einmal am Ende machst hast du deine Zeitdiff.
sast
Lesezeichen