flat assembler
Message board for the users of flat assembler.

Index > Main > measuring clock cycles...

Author
Thread Post new topic Reply to topic
decard



Joined: 11 Sep 2003
Posts: 1092
Location: Poland
decard 26 Jun 2004, 13:03
Hi,
does anyone know some (easy) way of measuring how much clock cycles it takes to execute some piece of code?
thanks
Post 26 Jun 2004, 13:03
View user's profile Send private message Visit poster's website Reply with quote
roticv



Joined: 19 Jun 2003
Posts: 374
Location: Singapore
roticv 26 Jun 2004, 14:06
Post 26 Jun 2004, 14:06
View user's profile Send private message Visit poster's website MSN Messenger Reply with quote
Ralph



Joined: 04 Oct 2003
Posts: 86
Ralph 26 Jun 2004, 19:41
rdtsc works well for that. It will return the current cycle count in EDX:EAX. Ideally you'll want to use cpuid to serialize the cpu so rdtsc does not execute out of order, and turn off interrupts so you don't get multitasking interference, unless you want that.
Post 26 Jun 2004, 19:41
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.