@Test public void scale() { OpTimer timer = new OpTimer().start(); try { Thread.sleep(50); } catch (InterruptedException ex) { log.info("sleep sleep interrupted"); Thread.currentThread().interrupt(); } timer.stop(); long tValue = timer.now(); assertEquals(tValue / 1000000.0, timer.scale(TimeUnit.MILLISECONDS), 0.00000001); assertEquals(tValue / 1000000000.0, timer.scale(TimeUnit.SECONDS), 0.00000001); }
public double scale(TimeUnit timeUnit) { return (double) now() / TimeUnit.NANOSECONDS.convert(1L, timeUnit); }
OpTimer { public double scale(TimeUnit timeUnit) { return (double) now() / TimeUnit.NANOSECONDS.convert(1L, timeUnit); } }
OpTimer { public double scale(TimeUnit timeUnit) { return (double) now() / TimeUnit.NANOSECONDS.convert(1L, timeUnit); }  }
OpTimer { public double scale(TimeUnit timeUnit) { return (double) now() / TimeUnit.NANOSECONDS.convert(1L, timeUnit); }  boolean isRunning(); OpTimer start(); OpTimer stop(); OpTimer reset(); long now(TimeUnit timeUnit); double scale(TimeUnit timeUnit); long now(); @Override String toString(); }
OpTimer { public double scale(TimeUnit timeUnit) { return (double) now() / TimeUnit.NANOSECONDS.convert(1L, timeUnit); }  boolean isRunning(); OpTimer start(); OpTimer stop(); OpTimer reset(); long now(TimeUnit timeUnit); double scale(TimeUnit timeUnit); long now(); @Override String toString();  }