@Test public void testStart() throws InterruptedException { Timer timer = Timer.getTimer(); assertEquals(0, timer.getElapsedMilliseconds()); assertEquals(0, timer.getLapMilliseconds()); timer.start(); Thread.sleep(1); assertTrue(timer.getElapsedMilliseconds() > 0); }
public Timer start() { if (this.startTime != null) { throw new IllegalStateException("Must reset Timer before starting again"); } this.startTime = System.currentTimeMillis(); this.lapTime = this.startTime; return this; }
Timer { public Timer start() { if (this.startTime != null) { throw new IllegalStateException("Must reset Timer before starting again"); } this.startTime = System.currentTimeMillis(); this.lapTime = this.startTime; return this; } }
Timer { public Timer start() { if (this.startTime != null) { throw new IllegalStateException("Must reset Timer before starting again"); } this.startTime = System.currentTimeMillis(); this.lapTime = this.startTime; return this; } private  Timer(); }
Timer { public Timer start() { if (this.startTime != null) { throw new IllegalStateException("Must reset Timer before starting again"); } this.startTime = System.currentTimeMillis(); this.lapTime = this.startTime; return this; } private  Timer(); static Timer getTimer(); Timer start(); Timer stop(); Timer lap(); Timer reset(); long getElapsedMilliseconds(); long getLapMilliseconds(); }
Timer { public Timer start() { if (this.startTime != null) { throw new IllegalStateException("Must reset Timer before starting again"); } this.startTime = System.currentTimeMillis(); this.lapTime = this.startTime; return this; } private  Timer(); static Timer getTimer(); Timer start(); Timer stop(); Timer lap(); Timer reset(); long getElapsedMilliseconds(); long getLapMilliseconds();  }