clock subroutine in mingw returns wall clock times
Don Scales
scaled@gatwick.geco-prakla.slb.com
Wed May 16 01:19:00 GMT 2001
There seems to be a problem with the clock subroutine in the mingw
library
libcrtdll.a
This subroutine should return the number of CPU clock ticks used by the
program at the time the subroutine is called.
The clock routine in the cygwin library works ok.
The clock routine in the mingw library seems to return wall clock time.
Regards
Don
----
#include <time.h>
#include <stdio.h>
int main() {
long ca,cb,wa,wb;
float c,w;
char s[10];
ca = clock();
wa=time(0);
printf("hit enter when ready");
gets(s);
cb=clock();
wb=time(0);
c=(float) cb-ca;
w=(float)wb-wa;
c = c/(float)CLOCKS_PER_SEC;
printf("wall=%f, cpu=%f\n",w,c);
}
--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple
More information about the Cygwin
mailing list