@Test public void testReset() throws Exception { testStopwatch.start(); Thread.sleep(10); testStopwatch.stop(); assertTrue(testStopwatch.getDuration() > 0); testStopwatch.reset(); assertTrue(testStopwatch.getDuration() == 0); }
@Test public void testGetDurationWithUnit() throws Exception { testStopwatch.start(); Thread.sleep(10); testStopwatch.stop(); assertTrue(testStopwatch.getDuration() > 12); }