/** * Returns the elapsed time between start and end as a string in the format "<i>hours</i>:<i>minutes</i>:<i>seconds</i>", * with <i>seconds</i> given as a decimal floating point number. * * @return the elapsed time as a string */ public String getTimeDiffString() { return getTimeString(getTimeDiff()); }
/** * Tests the functionality of getTimeDiff */ public void testGetTimeDiff() { StopWatch watch = new StopWatch(); long startTime; long endTime; startTime = watch.getStartTime(); watch.stop(); endTime = watch.getEndTime(); assertEquals(endTime - startTime, watch.getTimeDiff()); }