times.c 393 B

1234567891011121314151617
  1. #include <stdio.h>
  2. #include <sys/times.h>
  3. #include <unistd.h>
  4. #include "test_helpers.h"
  5. int main(void) {
  6. struct tms tms;
  7. int status = times(&tms);
  8. ERROR_IF(times, status, == (time_t)-1);
  9. printf("tm_utime: %ld\n", tms.tms_utime);
  10. printf("tm_stime: %ld\n", tms.tms_stime);
  11. printf("tm_cutime: %ld\n", tms.tms_cutime);
  12. printf("tm_cstime: %ld\n", tms.tms_cstime);
  13. }