utime/stime.tv_sec are elapsed times, not relative to 1970. We can

safely print them as longs.  Even if ^T overflows after a process
has accumulated 68 years of user or system time, it is no big deal.
This commit is contained in:
Peter Wemm 2001-11-17 00:26:57 +00:00
parent d2334e27e9
commit 857ff6155b

View file

@ -2349,12 +2349,12 @@ ttyinfo(tp)
stmp);
/* Print user time. */
ttyprintf(tp, "%lld.%02ldu ",
(long long)utime.tv_sec, utime.tv_usec / 10000);
ttyprintf(tp, "%ld.%02ldu ",
(long)utime.tv_sec, utime.tv_usec / 10000);
/* Print system time. */
ttyprintf(tp, "%lld.%02lds ",
(long long)stime.tv_sec, stime.tv_usec / 10000);
ttyprintf(tp, "%ld.%02lds ",
(long)stime.tv_sec, stime.tv_usec / 10000);
/* Print percentage cpu, resident set size. */
ttyprintf(tp, "%d%% %ldk\n", tmp / 100, ltmp);