clock.c 167 B

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