From owner-freebsd-bugs Sun Jun 20 17:50: 6 1999 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id 675C714C95 for ; Sun, 20 Jun 1999 17:50:03 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id RAA13010; Sun, 20 Jun 1999 17:50:03 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Date: Sun, 20 Jun 1999 17:50:03 -0700 (PDT) Message-Id: <199906210050.RAA13010@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Bruce Evans Subject: Re: kern/12305: clock() ticks backwards Reply-To: Bruce Evans Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org The following reply was made to PR kern/12305; it has been noted by GNATS. From: Bruce Evans To: FreeBSD-gnats-submit@FreeBSD.ORG, marcelk@bitpit.net Cc: Subject: Re: kern/12305: clock() ticks backwards Date: Mon, 21 Jun 1999 10:45:38 +1000 >>Description: > >Consecutive calls to clock() sometimes suggest negative elapsed time. This is probably fixed in -current: --- bde 1999/03/13 11:46:13 PST Modified files: sys/kern kern_resource.c sys/sys resourcevar.h Log: Enforce monotonicity of apparent process user, system and interrupt times. PR: 975, 10402 Revision Changes Path 1.45 +51 -22 src/sys/kern/kern_resource.c 1.13 +4 -1 src/sys/sys/resourcevar.h --- clock() could reduce this problem by adding the user and system times. This would also increase its precision from about 16000 usec to about 8000 usec. It discards about about 8000 usec of precision for historical reasons. (clock_t should be double so that CLOCKS_PER_SECOND can be 10^6 or 10^9.) Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message