/** Stop the stopwatch and add the interval to the accumulated total */ public void stop() { if (isRunning) { SimTime offset = SimTime.subtract(Harness.getTime(), startTime); accumulatedTime = SimTime.add(accumulatedTime, offset); startTime = null; isRunning = false; } }
/** Start the stopwatch */ public void start() { if (!isRunning) { startTime = Harness.getTime(); isRunning = true; } }