From: Tom Burgess 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 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk 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