delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/05/16/13:21:17

From: Tom Burgess <Tom_Burgess AT bc DOT sympatico DOT ca>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: very accurate djgpp inline asm tick counter
Date: Fri, 16 May 1997 08:28:44 -0700
Organization: BCTEL Advanced Communications
Lines: 16
Message-ID: <337C7D2C.73E@bc.sympatico.ca>
References: <5lhecg$lvv$3 AT bore DOT news DOT pipex DOT net>
NNTP-Posting-Host: pntn02m02-86.bctel.ca
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

nikki wrote:
> 
> does anyone (leath?) have an accurate time i can use for inline asm
> to tell me exactly how many clock cycles are being used in a routine?
> i have some not so accurate ones but i really need an accurate one for this
> application.
> 

If you are using a Pentium, no problem. It has a built in 64 bit cycle
counter accessible using the RDTSC instruction. I posted an example here
a few weeks ago which still shows up on a DejaNews search for "RDTSC".
Note: there should have been 8 NOPS instead of 6 in the anti-shadowing
preamble, not that it makes THAT much difference. If you can't find the
example, I can mail it to you. 

	regards, tom

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019