Subject: Clock() bug on B19
From: [email-masked] (Tein Horng Yuan)

24 Apr 1998 16:18:48 -0700
Message-ID: <[email-masked]>
Reply-To: "tyuan"@$#-n1H.U'#+H59'Z
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
To: [email-masked], [email-masked]

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 [email-masked]

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
"[email-masked]" with one line of text: "help".