g77 second function always returns 0.0 on mingw32/egcs-1.1

Billinghurst, David (RTD) David.Billinghurst@riotinto.com.au
Thu Sep 24 18:34:00 GMT 1998


The fortran function second() always returns 0.0 on mingw32/egcs-1.1.
second() uses etime() which isn't ANSI and doesn't seem to be present in
mingw32,
so it defaults to zero.

mingw32 does have the clock() function, so we could do something like

double G77_etime_0 (real tarray[2]
{
  tarray[0] = ((real)clock()) / CLOCK_PER_SEC;  /* user time */
  tarray[1] = 0.0; /* system time */
  return (tarray[0]+tarray[1]);
}

Any comments before I try it?

+++++++++++++++++++++++++++++++++++++++++
(Mr) David Billinghurst
Comalco Research and Technical Support
PO Box 316, Thomastown, Vic, Australia, 3074
Phone:	+61 3 9469 0642
FAX:	+61 3 9462 2700
Email:	David.Billinghurst@riotinto.com.au




More information about the Gcc mailing list