Exemplo n.º 1
0
  @Test
  public void testReset() throws Exception {
    testStopwatch.start();
    Thread.sleep(10);
    testStopwatch.stop();
    assertTrue(testStopwatch.getDuration() > 0);

    testStopwatch.reset();
    assertTrue(testStopwatch.getDuration() == 0);
  }
Exemplo n.º 2
0
  @Test
  public void testGetDurationWithUnit() throws Exception {
    testStopwatch.start();
    Thread.sleep(10);
    testStopwatch.stop();

    assertTrue(testStopwatch.getDuration() > 12);
  }