diff --git a/classpath/java/lang/System.java b/classpath/java/lang/System.java index 954c62d116..9506fb3457 100644 --- a/classpath/java/lang/System.java +++ b/classpath/java/lang/System.java @@ -20,6 +20,8 @@ import java.io.FileDescriptor; import java.util.Properties; public abstract class System { + private static final long NanoTimeBaseInMillis = currentTimeMillis(); + private static Property properties; private static SecurityManager securityManager; @@ -94,6 +96,10 @@ public abstract class System { public static native int identityHashCode(Object o); + public static long nanoTime() { + return (currentTimeMillis() - NanoTimeBaseInMillis) * 1000000; + } + public static String mapLibraryName(String name) { if (name != null) { return doMapLibraryName(name);