From 57585a8e54d338ffbd57b582d4445d0b48a2f6ea Mon Sep 17 00:00:00 2001 From: Mike Pritchard Date: Sun, 23 Jul 1995 23:02:20 +0000 Subject: Use the same method to determine the time that the process ended that fork() uses to determine the time that the process started when calculating the elapsed time. This prevents the ac_etime field in the accounting record from getting set to -1 if the process exists for a VERY short period of time. --- sys/kern/kern_acct.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'sys/kern/kern_acct.c') diff --git a/sys/kern/kern_acct.c b/sys/kern/kern_acct.c index 46ed69730c4b..c6c2b4247211 100644 --- a/sys/kern/kern_acct.c +++ b/sys/kern/kern_acct.c @@ -37,7 +37,7 @@ * SUCH DAMAGE. * * @(#)kern_acct.c 8.1 (Berkeley) 6/14/93 - * $Id: kern_acct.c,v 1.5 1994/09/26 21:09:00 davidg Exp $ + * $Id: kern_acct.c,v 1.6 1994/10/02 17:35:09 phk Exp $ */ #include @@ -183,9 +183,7 @@ acct_process(p) /* (3) The elapsed time the commmand ran (and its starting time) */ acct.ac_btime = p->p_stats->p_start.tv_sec; - s = splclock(); - tmp = time; - splx(s); + microtime(&tmp); timevalsub(&tmp, &p->p_stats->p_start); acct.ac_etime = encode_comp_t(tmp.tv_sec, tmp.tv_usec); -- cgit v1.2.3