| 44 | } |
| 45 | |
| 46 | private static class NanoTimeTimerImpl implements TimerImpl { |
| 47 | private final TimeUnit timeUnit; |
| 48 | private long start; |
| 49 | |
| 50 | public NanoTimeTimerImpl(TimeUnit timeUnit) { |
| 51 | this.timeUnit = timeUnit; |
| 52 | } |
| 53 | |
| 54 | @Override |
| 55 | public void start() { |
| 56 | start = System.nanoTime(); |
| 57 | } |
| 58 | |
| 59 | @Override |
| 60 | public double elapsed() { |
| 61 | return timeUnit.convert(System.nanoTime() - start, TimeUnit.NANOSECONDS); |
| 62 | } |
| 63 | } |
| 64 | |
| 65 | protected TimerImpl newTimerImpl() { |
| 66 | return new NanoTimeTimerImpl(timeUnit); |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…