Round - not cut - the real cpu time.

This commit is contained in:
Wolfram Schneider 1998-07-27 12:21:58 +00:00
parent a0f5e52d43
commit 4dc0ec1db1
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=37885

View File

@ -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));