/** * Purpose of this method is to make this class compatible with Groovy script standard for number operator "minus" * {@code '-'} overloading. See <a href="http://groovy-lang.org/operators.html">Groovy operators spec</a> section * "Operator overloading". * <p> * Performs same as {@link #difference(UsecTimestamp)}. * * @param other * other UsecTimestamp instance * @return difference, in microseconds, between two timestamps * * @see #difference(UsecTimestamp) */ public long minus(UsecTimestamp other) { return difference(other); } }
private void stopActivity() throws SAXException { long elapsed = simCurrTime.difference(curActivity.getStartTime()); curActivity.stop(simCurrTime, elapsed); TNT4JSimulator.debug(simCurrTime, "Stopped activity " + curActivity.getName() + ", elapsed.usec: " + elapsed); if (curActivity.getStatus() == ActivityStatus.BEGIN) { curActivity.setStatus(ActivityStatus.END); } Tracker tracker = trackers.get(curActivity.getSource().getFQName()); if (tracker != null) { tracker.tnt(curActivity); try { tracker.getEventSink().flush(); } catch (IOException e) { TNT4JSimulator.warn("Failed flushing event sink on stop of activity " + curActivity.getName(), e); } } curActivity = activeActivities.pop(); curActivityStart = null; curTracker = null; }