delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1998/04/24/16:18:48

From: tyuan AT dont DOT send DOT me DOT junk DOT mail (Tein Horng Yuan)
Subject: Clock() bug on B19
24 Apr 1998 16:18:48 -0700 :
Message-ID: <35405FAB.D08B9A3F.cygnus.gnu-win32@dont.send.me.junk.mail>
Reply-To: "tyuan"@$#-n1H.U'#+H59'Z
Mime-Version: 1.0
To: gnu-win32 AT cygnus DOT com, tyuan AT beta DOT wsl DOT sinica DOT edu DOT tw

Hi,

I am running gnu-win32 B19-1 on a PII-233 system.  Because I need to
measure
the CPU time, I find out 'clock' is not function correct.  A test
program is attached.
Please send me email to tyuan AT beta DOT wsl DOT sinica DOT edu DOT tw

By the way, will you have Pentium II optimization version of gcc?
Thanks.

-- Tein
-------------------- The output is ------------------------

G:\>test
0, 1594649.621000, 1649776.485000
1, 4247722.656000, -2653073.035000
2, 4247722.656000, 0.000000
3, 4247722.656000, 0.000000
4, 4247722.656000, 0.000000
5, 4247722.656000, 0.000000
6, 4247722.656000, 0.000000

--------------  source code ------------------
#include <stdio.h>
#include <time.h>
#include <math.h>
typedef double REAL;
REAL second(void)
{ return ((REAL)((REAL)clock()/(REAL)CLOCKS_PER_SEC)); }

main(){
double a,b,c;

long i,j,k,l,m,n,o,p;
c= 0;
b= second();
for(i=0; i<1024 * 1024 * 1024; i ++) {

  for(k=0; k<1024  ; k ++)
  for(l=0; l<1024 ; l ++)
    a = sin(l) + cos(k);
 c=b;
 b=second();
 c= c - b;
 printf("%i, %f, %f\n", i, b, c);
 }
}



-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


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