Esempio n. 1
0
  @Test
  public void testGetDurationWithUnit() throws Exception {
    testStopwatch.start();
    Thread.sleep(10);
    testStopwatch.stop();

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

    testStopwatch.reset();
    assertTrue(testStopwatch.getDuration() == 0);
  }