From e59a1e40f318e53c11a069140e4380ca05dd75cd Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Thu, 9 Mar 2006 18:47:54 +0000 Subject: win32.cc (_Jv_platform_nanotime): New function. * win32.cc (_Jv_platform_nanotime): New function. * include/win32.h (_Jv_platform_nanotime): Declare. * posix.cc (_Jv_platform_nanotime): New function. * include/posix.h (_Jv_platform_nanotime): Declare. * java/lang/natSystem.cc (nanoTime): New method. * java/lang/System.java (nanoTime): Declare. * include/config.h.in, configure: Rebuilt. * configure.ac: Check for clock_gettime. From-SVN: r111869 --- libjava/java/lang/System.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'libjava/java/lang/System.java') diff --git a/libjava/java/lang/System.java b/libjava/java/lang/System.java index 005cba1397c..8ba0e8960cb 100644 --- a/libjava/java/lang/System.java +++ b/libjava/java/lang/System.java @@ -1,5 +1,5 @@ /* System.java -- useful methods to interface with the system - Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 + Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -207,6 +207,15 @@ public final class System */ public static native long currentTimeMillis(); + /** + * Get the current time, measured in nanoseconds. The result is as + * precise as possible, and is measured against a fixed epoch. + * However, unlike currentTimeMillis(), the epoch chosen is + * arbitrary and may vary by platform, etc. + * @since 1.5 + */ + public static native long nanoTime(); + /** * Copy one array onto another from src[srcStart] ... * src[srcStart+len-1] to dest[destStart] ... -- cgit v1.2.3