1 /*$Id$*/ 2 3 #if defined(USE_CLOCK) 4 #include <time.h> 5 ibm_cputime_()6double ibm_cputime_() 7 { 8 return clock()/CLOCKS_PER_SEC; 9 } 10 #else 11 #include <sys/types.h> 12 #include <sys/times.h> 13 #define FAC2SEC 0.01 14 ibm_cputime_()15double ibm_cputime_() 16 { 17 struct tms bufff; 18 double e; 19 time_t tt; 20 double tarray[2]; 21 22 tt = times(&bufff); 23 tarray[0] = FAC2SEC * bufff.tms_utime; 24 tarray[1] = FAC2SEC * bufff.tms_stime; 25 e = tarray[0] + tarray[1] ; 26 return e; 27 } 28 #endif 29