* c-common.c (parse_in): Make a cpp_reader *.
[official-gcc.git] / libf2c / libF77 / etime_.c
blobe88cfd886484e4a2c9c040c189909b358364860b
1 #include "time.h"
3 #ifdef MSDOS
4 #undef USE_CLOCK
5 #define USE_CLOCK
6 #endif
8 #ifndef USE_CLOCK
9 #define _INCLUDE_POSIX_SOURCE /* for HP-UX */
10 #define _INCLUDE_XOPEN_SOURCE /* for HP-UX */
11 #include "sys/types.h"
12 #include "sys/times.h"
13 #endif
15 #undef Hz
16 #ifdef CLK_TCK
17 #define Hz CLK_TCK
18 #else
19 #ifdef HZ
20 #define Hz HZ
21 #else
22 #define Hz 60
23 #endif
24 #endif
26 double
27 #ifdef KR_headers
28 etime_(tarray) float *tarray;
29 #else
30 etime_(float *tarray)
31 #endif
33 #ifdef USE_CLOCK
34 #ifndef CLOCKS_PER_SECOND
35 #define CLOCKS_PER_SECOND Hz
36 #endif
37 double t = clock();
38 tarray[1] = 0;
39 return tarray[0] = t / CLOCKS_PER_SECOND;
40 #else
41 struct tms t;
43 times(&t);
44 return (tarray[0] = t.tms_utime/Hz) + (tarray[1] = t.tms_stime/Hz);
45 #endif