diff --git a/src/test/java/org/apache/commons/lang3/time/StopWatchTest.java b/src/test/java/org/apache/commons/lang3/time/StopWatchTest.java index fddf9fcc7..1d8037d65 100644 --- a/src/test/java/org/apache/commons/lang3/time/StopWatchTest.java +++ b/src/test/java/org/apache/commons/lang3/time/StopWatchTest.java @@ -200,8 +200,10 @@ public class StopWatchTest extends AbstractLangTest { assertEquals(Duration.ZERO, watch.getDuration()); assertEquals(ZERO_TIME_ELAPSED, watch.toString()); watch.start(); - sleep(MILLIS_550); - assertThat("watch.getDuration()", watch.getDuration().toMillis(), lessThan(2000L)); + sleep(Duration.ofMillis(1)); + final long nanos = watch.getNanoTime(); + assertTrue(nanos > 0, () -> "getNanoTime(): " + nanos); + assertTrue(DurationUtils.isPositive(watch.getDuration())); } @Test