19 #include <sys/times.h>
24 if (_before) printf(
"%s", _before);
25 printf(
"time used : user (");
27 unsigned int minutes = (now.tms_utime-_since->tms_utime)/CLOCKS_PER_SEC / 60;
28 unsigned int hours = minutes / 60;
29 minutes -= hours * 60;
30 if (hours > 0) printf(
"%uh ", hours);
31 if (minutes > 0) printf(
"%um ", minutes);
32 printf(
"%.3fs) system (", (
float)(now.tms_utime-_since->tms_utime)/CLOCKS_PER_SEC-(hours*3600)-(minutes*60));
33 minutes = (now.tms_stime-_since->tms_stime)/CLOCKS_PER_SEC / 60;
35 minutes -= hours * 60;
36 if (hours > 0) printf(
"%uh ", hours);
37 if (minutes > 0) printf(
"%um ", minutes);
38 printf(
"%.3fs)", (
float)(now.tms_stime-_since->tms_stime)/CLOCKS_PER_SEC-(hours*3600)-(minutes*60));