X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f Date: Mon, 3 Dec 2001 08:38:22 +0200 (WET) From: Andris Pavenis X-Sender: pavenis AT ieva06 To: Damien Knight Cc: djgpp AT delorie DOT com Subject: Re: RDTSC ? In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Sun, 2 Dec 2001, Damien Knight wrote: > As I've been told, RDTSC is a feature of pentium (and up) processers that > tracks the number of processer cycles completed since the system last > powered up, making it useful for calculating system uptime - but more > importantly, it can be used to test code optimization and so on. > > My question : How do I get this value and use in in a DJGPP program? If > anyone has a function already written, that'd be great. > inline long long rdtsc (void) { long long result; asm volatile ("rdtsc" : "=A"(result)); return result; }