@Test public void elapsedSeconds() throws Exception { SimpleTimer.TimeProvider provider = new SimpleTimer.TimeProvider() { long value = (long)(30 * 1e9); long nanoTime() { value += (long)(10 * 1e9); return value; } }; SimpleTimer timer = new SimpleTimer(provider); assertEquals(10, timer.elapsedSeconds(), .001); }
public double elapsedSeconds() { return elapsedSecondsFromNanos(start, timeProvider.nanoTime()); }
SimpleTimer { public double elapsedSeconds() { return elapsedSecondsFromNanos(start, timeProvider.nanoTime()); } }
SimpleTimer { public double elapsedSeconds() { return elapsedSecondsFromNanos(start, timeProvider.nanoTime()); } SimpleTimer(TimeProvider timeProvider);  SimpleTimer(); }
SimpleTimer { public double elapsedSeconds() { return elapsedSecondsFromNanos(start, timeProvider.nanoTime()); } SimpleTimer(TimeProvider timeProvider);  SimpleTimer(); double elapsedSeconds(); static double elapsedSecondsFromNanos(long startNanos, long endNanos); }
SimpleTimer { public double elapsedSeconds() { return elapsedSecondsFromNanos(start, timeProvider.nanoTime()); } SimpleTimer(TimeProvider timeProvider);  SimpleTimer(); double elapsedSeconds(); static double elapsedSecondsFromNanos(long startNanos, long endNanos);  }