@Test public void testStopWatchStatic() throws Throwable { long now = System.currentTimeMillis(); String s = StopWatch.get(500, TimeUnit.MILLISECONDS, () -> "The Quick Brown Fox jumps over the laxy dog"); assertTrue(System.currentTimeMillis() - now >= 500); }
public static <T> T get(long period, TimeUnit unit, Supplier<T> f) { StopWatch w = new StopWatch(period, unit); T t = f.get(); w.finish(); return t; }
StopWatch { public static <T> T get(long period, TimeUnit unit, Supplier<T> f) { StopWatch w = new StopWatch(period, unit); T t = f.get(); w.finish(); return t; } }
StopWatch { public static <T> T get(long period, TimeUnit unit, Supplier<T> f) { StopWatch w = new StopWatch(period, unit); T t = f.get(); w.finish(); return t; } StopWatch(long period, TimeUnit unit);  StopWatch(long periodInMillis); }
StopWatch { public static <T> T get(long period, TimeUnit unit, Supplier<T> f) { StopWatch w = new StopWatch(period, unit); T t = f.get(); w.finish(); return t; } StopWatch(long period, TimeUnit unit);  StopWatch(long periodInMillis); void finish(); boolean isFinished(); static T get(long period, TimeUnit unit, Supplier<T> f); static T get(long period, Supplier<T> f); }
StopWatch { public static <T> T get(long period, TimeUnit unit, Supplier<T> f) { StopWatch w = new StopWatch(period, unit); T t = f.get(); w.finish(); return t; } StopWatch(long period, TimeUnit unit);  StopWatch(long periodInMillis); void finish(); boolean isFinished(); static T get(long period, TimeUnit unit, Supplier<T> f); static T get(long period, Supplier<T> f);  }