Skip to content

Instantly share code, notes, and snippets.

@fjolnir
Created November 25, 2011 12:16
Show Gist options
  • Save fjolnir/1393388 to your computer and use it in GitHub Desktop.
Save fjolnir/1393388 to your computer and use it in GitHub Desktop.
#define StartRecordTime( start ) \
__asm mov saved_ebx, ebx \
__asm xor eax, eax \
__asm cpuid \
__asm rdtsc \
__asm mov start, eax \
__asm xor eax, eax \
__asm cpuid
#define StopRecordTime( end ) \
__asm xor eax, eax \
__asm cpuid \
__asm rdtsc \
__asm mov end, eax \
__asm mov ebx, saved_ebx \
__asm xor eax, eax \
__asm cpuid
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment