Mail Archives: cygwin/1997/06/04/21:06:23
I just got started with gnu-win32 (w95). I encountered strange results
with the 'times' library function (I know, this is obsolete but I also
encountered strange though different results with the 'getrusage' system
call). 'times' calls return should return number of 'CLK_TCK' since
invocation of the current process. Instead it returns very big numbers
(millions).
The following routine is taken from an old Berkeley f77 distribution:
#include <sys/types.h>
#include <sys/times.h>
#include <time.h>
struct tb { float usrtime; float systime; };
float
etime_(et) struct tb *et;
{ struct tms clock;
times(&clock);
et->usrtime = (float) clock.tms_utime / (float)CLK_TCK;
et->systime = (float) clock.tms_stime / (float)CLK_TCK;
return(et->usrtime + et->systime);
}
This works fine under f2c or g77 and many Unix systems including Linux
and Solaris but gives strange under g77 and gnu-win32.
Thanks in advance.
--
Daniel P. Siu
Microwave Monolithics Incorporated
465 E. Easy Street, Simi Valley, CA 93065, USA
VOICE:805-584-6642 FAX:805-584-9594 EMAIL:dps AT micro-mono DOT com
-
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 -