1 #include <time.h> 2 #include <sys/times.h> 3 4 clock_t clock(void)5 clock(void) 6 { 7 struct tms t; 8 9 if(times(&t) == (clock_t)-1) 10 return (clock_t)-1; 11 return t.tms_utime+t.tms_stime; 12 } 13