times.c 333 B

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