diff options
author | wosch <wosch@FreeBSD.org> | 1998-07-27 12:21:58 +0000 |
---|---|---|
committer | wosch <wosch@FreeBSD.org> | 1998-07-27 12:21:58 +0000 |
commit | ff2f7584e8645ddd7fa607e4ae1419fef90515f6 (patch) | |
tree | 27c9232d51e9389d67a883f7ce4198806bcddf26 /usr.bin/top/machine.c | |
parent | 7dbfcf7956b0a9b0fe85de508f84e27ccca82d6f (diff) | |
download | FreeBSD-src-ff2f7584e8645ddd7fa607e4ae1419fef90515f6.zip FreeBSD-src-ff2f7584e8645ddd7fa607e4ae1419fef90515f6.tar.gz |
Round - not cut - the real cpu time.
Diffstat (limited to 'usr.bin/top/machine.c')
-rw-r--r-- | usr.bin/top/machine.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/top/machine.c b/usr.bin/top/machine.c index dba333b..7d22e25 100644 --- a/usr.bin/top/machine.c +++ b/usr.bin/top/machine.c @@ -17,7 +17,7 @@ * Steven Wallace <swallace@freebsd.org> * Wolfram Schneider <wosch@FreeBSD.org> * - * $Id: machine.c,v 1.10 1998/05/28 09:29:48 phk Exp $ + * $Id: machine.c,v 1.11 1998/06/21 18:00:34 dt Exp $ */ @@ -565,7 +565,8 @@ char *(*get_userid)(); /* This does not produce the correct results */ cputime = PP(pp, p_uticks) + PP(pp, p_sticks) + PP(pp, p_iticks); #endif - cputime = PP(pp, p_runtime) / 1000000; /* This does not count interrupts */ + /* This does not count interrupts */ + cputime = (PP(pp, p_runtime) / 1000 + 500) / 1000; /* calculate the base for cpu percentages */ pct = pctdouble(PP(pp, p_pctcpu)); |