@Test public void isTimeExceeded1() throws Exception { long testDelta = 1000; LocalDateTime oldTime = LocalDateTime.now().minusSeconds(testDelta); Assert.assertTrue(TimeoutTimer.isTimeExceeded(oldTime, (long) (testDelta * 0.5))); Assert.assertFalse(TimeoutTimer.isTimeExceeded(oldTime, testDelta * 2)); Assert.assertTrue(TimeoutTimer.isTimeExceeded(oldTime, (testDelta * 0.5))); Assert.assertFalse(TimeoutTimer.isTimeExceeded(oldTime, testDelta * 2.0)); double testDeltaDouble = 0.005; oldTime = LocalDateTime.now().minusNanos((long) (testDeltaDouble * 1e9)); Assert.assertTrue(TimeoutTimer.isTimeExceeded(oldTime, (testDeltaDouble * 0.5))); Assert.assertFalse(TimeoutTimer.isTimeExceeded(oldTime, testDeltaDouble * 2.0)); }
public static boolean isTimeExceeded(long startTime, double timeout) { return (startTime + timeout) < System.currentTimeMillis(); }
TimeoutTimer { public static boolean isTimeExceeded(long startTime, double timeout) { return (startTime + timeout) < System.currentTimeMillis(); } }
TimeoutTimer { public static boolean isTimeExceeded(long startTime, double timeout) { return (startTime + timeout) < System.currentTimeMillis(); } TimeoutTimer(double timeout); }
TimeoutTimer { public static boolean isTimeExceeded(long startTime, double timeout) { return (startTime + timeout) < System.currentTimeMillis(); } TimeoutTimer(double timeout); static boolean isTimeExceeded(long startTime, double timeout); static boolean isTimeExceeded(LocalDateTime startTime, long timeout); static boolean isTimeExceeded(LocalDateTime startTime, double timeout); synchronized void reset(); synchronized boolean timeIsExceeded(); }
TimeoutTimer { public static boolean isTimeExceeded(long startTime, double timeout) { return (startTime + timeout) < System.currentTimeMillis(); } TimeoutTimer(double timeout); static boolean isTimeExceeded(long startTime, double timeout); static boolean isTimeExceeded(LocalDateTime startTime, long timeout); static boolean isTimeExceeded(LocalDateTime startTime, double timeout); synchronized void reset(); synchronized boolean timeIsExceeded();  }