static void func_time(char *buf, int size, const procps_status_t *ps) { /* cumulative time [[dd-]hh:]mm:ss; here only mm:ss */ unsigned long mm; mm = (ps->utime + ps->stime) / get_kernel_HZ(); format_time(buf, size, mm); }
static void func_etime(char *buf, int size, const procps_status_t *ps) { /* elapsed time [[dd-]hh:]mm:ss; here only mm:ss */ unsigned long mm; mm = ps->start_time / get_kernel_HZ(); mm = G.seconds_since_boot - mm; format_time(buf, size, mm); }
static void func_time(char *buf, int size, const procps_status_t *ps) { /* cumulative time [[dd-]hh:]mm:ss; here only mm:ss */ unsigned long mm; unsigned ss; mm = (ps->utime + ps->stime) / get_kernel_HZ(); ss = mm % 60; mm /= 60; snprintf(buf, size+1, "%3lu:%02u", mm, ss); }
static void func_etime(char *buf, int size, const procps_status_t *ps) { /* elapsed time [[dd-]hh:]mm:ss; here only mm:ss */ unsigned long mm; unsigned ss; mm = ps->start_time / get_kernel_HZ(); /* must be after get_kernel_HZ()! */ mm = seconds_since_boot - mm; ss = mm % 60; mm /= 60; snprintf(buf, size+1, "%3lu:%02u", mm, ss); }