MCPcopy Index your code
hub / github.com/BruceEckel/OnJava8-Examples / duration

Method duration

onjava/Timer.java:10–13  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

8public class Timer {
9 private long start = System.nanoTime();
10 public long duration() {
11 return NANOSECONDS.toMillis(
12 System.nanoTime() - start);
13 }
14 public static long duration(Runnable test) {
15 Timer timer = new Timer();
16 test.run();

Callers 11

mainMethod · 0.95
timeTestMethod · 0.95
mainMethod · 0.95
mainMethod · 0.95
mainMethod · 0.95
mainMethod · 0.95
mainMethod · 0.95
mainMethod · 0.95
mainMethod · 0.95
mainMethod · 0.95
mainMethod · 0.95

Calls 1

runMethod · 0.65

Tested by

no test coverage detected