head 1.1; access; symbols OPENPKG_E1_MP_HEAD:1.1 OPENPKG_E1_MP:1.1 OPENPKG_E1_MP_2_STABLE:1.1.2.2 OPENPKG_E1_FP:1.1.2.2 OPENPKG_2_STABLE_MP:1.1 OPENPKG_2_STABLE_20061018:1.1.2.2 OPENPKG_2_STABLE:1.1.0.2 OPENPKG_CW_FP:1.1; locks; strict; comment @# @; 1.1 date 2004.08.22.11.15.32; author rse; state Exp; branches 1.1.2.1; next ; 1.1.2.1 date 2004.08.22.11.15.32; author rse; state dead; branches; next 1.1.2.2; commitid iZxwRSmmWscPXUQr; 1.1.2.2 date 2006.10.16.14.57.55; author rse; state Exp; branches; next ; commitid iZxwRSmmWscPXUQr; desc @@ 1.1 log @commit patch to CVS @ text @Index: whetstone.c --- whetstone.c.orig Sun Aug 30 10:03:47 1998 +++ whetstone.c Sun Aug 30 10:06:00 1998 @@@@ -59,6 +59,12 @@@@ /* the following is optional depending on the timing function used */ #include +#ifdef CLOCKS_PER_SEC +#define mytime() clock() +#else +#define mytime() time(0) +#define CLOCKS_PER_SEC 1 +#endif /* map the FORTRAN math functions, etc. to the C versions */ #define DSIN sin @@@@ -120,7 +126,7 @@@@ C Start benchmark timing at this point. C */ - startsec = time(0); + startsec = mytime(); /* C @@@@ -355,7 +361,7 @@@@ C Stop benchmark timing at this point. C */ - finisec = time(0); + finisec = mytime(); /* C---------------------------------------------------------------- @@@@ -367,15 +373,16 @@@@ C-------------------------------------------------------------------- */ printf("\n"); - if (finisec-startsec <= 0) { + if (finisec-startsec <= 100) { printf("Insufficient duration- Increase the LOOP count\n"); return(1); } - printf("Loops: %ld, Iterations: %d, Duration: %ld sec.\n", - LOOP, II, finisec-startsec); + printf("Loops: %ld, Iterations: %d, Duration: %f sec.\n", + LOOP, II, + (float)(finisec-startsec)/(float)CLOCKS_PER_SEC); - KIPS = (100.0*LOOP*II)/(float)(finisec-startsec); + KIPS = (100.0*LOOP*II*CLOCKS_PER_SEC)/(float)(finisec-startsec); if (KIPS >= 1000.0) printf("C Converted Double Precision Whetstones: %.1f MIPS\n", KIPS/1000.0); else @ 1.1.2.1 log @file whetstone.patch was added on branch OPENPKG_2_STABLE on 2006-10-16 14:57:55 +0000 @ text @d1 55 @ 1.1.2.2 log @Mass merge from CURRENT to 2-STABLE (all packages except those of JUNK class) @ text @a0 55 Index: whetstone.c --- whetstone.c.orig Sun Aug 30 10:03:47 1998 +++ whetstone.c Sun Aug 30 10:06:00 1998 @@@@ -59,6 +59,12 @@@@ /* the following is optional depending on the timing function used */ #include +#ifdef CLOCKS_PER_SEC +#define mytime() clock() +#else +#define mytime() time(0) +#define CLOCKS_PER_SEC 1 +#endif /* map the FORTRAN math functions, etc. to the C versions */ #define DSIN sin @@@@ -120,7 +126,7 @@@@ C Start benchmark timing at this point. C */ - startsec = time(0); + startsec = mytime(); /* C @@@@ -355,7 +361,7 @@@@ C Stop benchmark timing at this point. C */ - finisec = time(0); + finisec = mytime(); /* C---------------------------------------------------------------- @@@@ -367,15 +373,16 @@@@ C-------------------------------------------------------------------- */ printf("\n"); - if (finisec-startsec <= 0) { + if (finisec-startsec <= 100) { printf("Insufficient duration- Increase the LOOP count\n"); return(1); } - printf("Loops: %ld, Iterations: %d, Duration: %ld sec.\n", - LOOP, II, finisec-startsec); + printf("Loops: %ld, Iterations: %d, Duration: %f sec.\n", + LOOP, II, + (float)(finisec-startsec)/(float)CLOCKS_PER_SEC); - KIPS = (100.0*LOOP*II)/(float)(finisec-startsec); + KIPS = (100.0*LOOP*II*CLOCKS_PER_SEC)/(float)(finisec-startsec); if (KIPS >= 1000.0) printf("C Converted Double Precision Whetstones: %.1f MIPS\n", KIPS/1000.0); else @