@Test public void testLap() throws InterruptedException { Timer timer = Timer.getTimer(); timer.start(); Thread.sleep(1); timer.lap(); Thread.sleep(1); assertTrue(timer.getLapMilliseconds() > 0); assertTrue(timer.getElapsedMilliseconds() > timer.getLapMilliseconds()); }
public Timer lap() { if (this.startTime == null) { throw new IllegalStateException("Timer must be started before lapping."); } this.lapTime = this.getFinalTime(); return this; }
Timer { public Timer lap() { if (this.startTime == null) { throw new IllegalStateException("Timer must be started before lapping."); } this.lapTime = this.getFinalTime(); return this; } }
Timer { public Timer lap() { if (this.startTime == null) { throw new IllegalStateException("Timer must be started before lapping."); } this.lapTime = this.getFinalTime(); return this; } private  Timer(); }
Timer { public Timer lap() { if (this.startTime == null) { throw new IllegalStateException("Timer must be started before lapping."); } this.lapTime = this.getFinalTime(); return this; } private  Timer(); static Timer getTimer(); Timer start(); Timer stop(); Timer lap(); Timer reset(); long getElapsedMilliseconds(); long getLapMilliseconds(); }
Timer { public Timer lap() { if (this.startTime == null) { throw new IllegalStateException("Timer must be started before lapping."); } this.lapTime = this.getFinalTime(); return this; } private  Timer(); static Timer getTimer(); Timer start(); Timer stop(); Timer lap(); Timer reset(); long getElapsedMilliseconds(); long getLapMilliseconds();  }