diff --git a/src/main/java/com/lmax/disruptor/dsl/Disruptor.java b/src/main/java/com/lmax/disruptor/dsl/Disruptor.java index 4ad200c98..f202d333a 100644 --- a/src/main/java/com/lmax/disruptor/dsl/Disruptor.java +++ b/src/main/java/com/lmax/disruptor/dsl/Disruptor.java @@ -404,10 +404,10 @@ public void shutdown() */ public void shutdown(final long timeout, final TimeUnit timeUnit) throws TimeoutException { - final long timeOutAt = System.currentTimeMillis() + timeUnit.toMillis(timeout); + final long timeOutAt = System.nanoTime() + timeUnit.toNanos(timeout); while (hasBacklog()) { - if (timeout >= 0 && System.currentTimeMillis() > timeOutAt) + if (timeout >= 0 && System.nanoTime() > timeOutAt) { throw TimeoutException.INSTANCE; }