/** * Check if the elapsed time is greater than the timeout limit and throw a TimeoutException if that is the case. Check the parent timer if there is one. * * @throws TimeoutException * @throws TimerInterruptedException */ public void check() throws TimeoutException, TimerInterruptedException { if (interrupted) { interrupted = false; throw new TimerInterruptedException("Timer " + getName() + " interrupted."); } final long elapsed = getElapsed(); if (_timeout != NO_TIMEOUT && elapsed > _timeout) throw new TimeoutException("Running time of " + _name + " exceeded timeout of " + _timeout); if (_parent != null) _parent.check(); }
/** * Check if the elapsed time is greater than the timeout limit and throw a TimeoutException if that is the case. Check the parent timer if there is one. * * @throws TimeoutException * @throws TimerInterruptedException */ public void check() throws TimeoutException, TimerInterruptedException { if (interrupted) { interrupted = false; throw new TimerInterruptedException("Timer " + getName() + " interrupted."); } final long elapsed = getElapsed(); if (_timeout != NO_TIMEOUT && elapsed > _timeout) throw new TimeoutException("Running time of " + _name + " exceeded timeout of " + _timeout); if (_parent != null) _parent.check(); }
row.add(timer.getName()); if (!shortForm)
row.add(timer.getName()); if (!shortForm)
for (final Timer timer : timers.getTimers()) if (!timer.isStarted()) System.out.println(timer.getName() + ": " + timer.getTotal() + "ms");
for (final Timer timer : timers.getTimers()) if (!timer.isStarted()) System.out.println(timer.getName() + ": " + timer.getTotal() + "ms");