# HG changeset patch # User igerasim # Date 1397832410 -14400 # Node ID a73b9a26a9ae472524989c7d574c12f7b5ea14cc # Parent f90208c69fb62eeac6546e0b786f74aa6e5c86f9 8038982: java/lang/ref/EarlyTimeout.java failed again Reviewed-by: mchung diff -r f90208c69fb6 -r a73b9a26a9ae test/java/lang/ref/EarlyTimeout.java --- a/test/java/lang/ref/EarlyTimeout.java Wed Apr 02 12:17:25 2014 +0400 +++ b/test/java/lang/ref/EarlyTimeout.java Fri Apr 18 18:46:50 2014 +0400 @@ -33,6 +33,7 @@ import java.lang.ref.ReferenceQueue; import java.lang.ref.WeakReference; import java.util.concurrent.CountDownLatch; +import static java.util.concurrent.TimeUnit.NANOSECONDS; /** * In order to demonstrate the issue we make several threads (two appears to be sufficient) @@ -93,9 +94,9 @@ public void run() { try { startedSignal.countDown(); - long start = System.currentTimeMillis(); + long start = System.nanoTime(); reference = queue.remove(TIMEOUT); - actual = System.currentTimeMillis() - start; + actual = NANOSECONDS.toMillis(System.nanoTime() - start); } catch (InterruptedException ex) { throw new RuntimeException(ex); }