| delorie.com/archives/browse.cgi | search |
| 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 <pavenis AT lanet DOT lv> |
| X-Sender: | pavenis AT ieva06 |
| To: | Damien Knight <spook AT kmfms DOT com> |
| Cc: | djgpp AT delorie DOT com |
| Subject: | Re: RDTSC ? |
| In-Reply-To: | <u0lpbq1krber57@corp.supernews.com> |
| Message-ID: | <Pine.A41.4.05.10112030837410.57664-100000@ieva06> |
| MIME-Version: | 1.0 |
| 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 |
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;
}
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |