X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f From: "Alex Vinokur" Newsgroups: comp.os.msdos.djgpp Subject: Re: uclock_t & gcc 3.0.4 on Windows-2000 Date: Wed, 24 Apr 2002 08:26:45 +0200 Organization: Scopus Lines: 63 Message-ID: References: NNTP-Posting-Host: gateway.scopus.net (62.90.123.5) X-Trace: fu-berlin.de 1019625918 8539143 62.90.123.5 (16 [79865]) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com "Eli Zaretskii" wrote in message news:Pine DOT SUN DOT 3 DOT 91 DOT 1020424083902 DOT 4915B-100000 AT is... | | On Wed, 24 Apr 2002, Alex Vinokur wrote: | | > | > So, what is alternative ? | > | > * rusage ? Does it work ? | > | > * something else ? | > | | > | It depends on what are you trying to accomplish. Can you tell some | > | more details? | > | > For instance, something like (pseudo-code) : | > | > | > void foo () | > { | > start_time = some-get-time-function(); | > // stuff | > end_time = some-get-time-function(); | > assert (start_time <= end_time); | > cout << (end_time - start_time) << endl; | > } | > | > int main () | > { | > for (int i = 0; i < TOTAL-ITERATIONS; i++) | > { | > foo (); | > } | > } | | Yes, but what is this for? This is a toy program; I was interested to | hear about some real-life application which needs that. | | The important question is: can you settle for the basic 54-msec | resolution of the standard PC clock? If you can, use `clock' (or | compile with -pg and use Gprof); if not, you will have to write some | inline assembly using the RDTSC (sp?) instruction. (I think someone | posted such assembly here some time ago, so searching the DJGPP archives | might find it.) Here is my problem. C/C++ Perfometer at http://alexvn.freeservers.com/s1/perfometer.html has been compiled with gpp-2.95.3 and works OK on Windows98. One of get-time-function()'s is uclock(). I compiled this program with gpp-3.0.4 (with some gpp-3.0.4-related updates) on Windows2000. However, it doesn't work on Windows2000 because of uclock(). ==================== Alex Vinokur http://up.to/alexvn http://go.to/alexv_math mailto:alexvn AT bigfoot DOT com mailto:alexvn AT go DOT to ====================