This is the mail archive of the
cygwin@sourceware.cygnus.com
mailing list for the Cygwin project.
Clock() bug on B19
- To: gnu-win32 at cygnus dot com, tyuan at beta dot wsl dot sinica dot edu dot tw
- Subject: Clock() bug on B19
- From: Tein Horng Yuan <tyuan at dont dot send dot me dot junk dot mail>
- Date: Fri, 24 Apr 1998 17:47:23 +0800
- Organization: Academia Sinica Computing Centre
- Reply-To: "tyuan"@$#-n1H.U'#+H59'Z
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@beta.wsl.sinica.edu.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@cygnus.com" with one line of text: "help".