From owner-freebsd-java Thu Oct 7 17: 0:49 1999 Delivered-To: freebsd-java@freebsd.org Received: from bubba.whistle.com (bubba.whistle.com [207.76.205.7]) by hub.freebsd.org (Postfix) with ESMTP id 4DB1D14E01 for ; Thu, 7 Oct 1999 17:00:44 -0700 (PDT) (envelope-from archie@whistle.com) Received: (from archie@localhost) by bubba.whistle.com (8.9.2/8.9.2) id QAA88501; Thu, 7 Oct 1999 16:57:41 -0700 (PDT) From: Archie Cobbs Message-Id: <199910072357.QAA88501@bubba.whistle.com> Subject: Re: time measurement in Java In-Reply-To: <199910071614.KAA00139@mt.sri.com> from Nate Williams at "Oct 7, 1999 10:14:56 am" To: arashfar@sfsu.edu Date: Thu, 7 Oct 1999 16:57:41 -0700 (PDT) Cc: freebsd-java@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL54 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-java@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Nate Williams writes: > > I would greatly appreciate if you would please give me your advice on > > which method is better to measure time in Java, or guide me on where to > > look for it. In particular, it would be great it can measure time in > > units less than milliseconds. > > System.currentTimeMillis() and Calendar (don't remember where,maybe > java.util). java.util.Date is always a good start. System.currentTimeMillis() returns time in milliseconds (obviously). I don't think there's any point in measuring time any more precisely, because of the slowness and variances in the execution of Java itself. More precision would be 'false precision' I think.. -Archie ___________________________________________________________________________ Archie Cobbs * Whistle Communications, Inc. * http://www.whistle.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-java" in the body of the message