public synchronized long getLapTime() { return this.watch.getLapTime(); }
public long stop() { return watch.stop(); }
public synchronized long getAverageLapTime() { return this.watch.getAverageLapTime(); }
/** * Get the average <i>lap</i> time since the watch was started. * * @return Average <i>lap</i> time since the watch was started. */ public long getAverageLapTime() { return (count == 0) ? 0 : getLapTime() / getLapCount(); }
StopWatch watch = new StopWatch(true); msg.setUserData(new Long(watch.getLapTime())); sendNotification(msg); watch.stop();
/** * Return a string representation. */ public String toString() { StringBuffer buff = new StringBuffer(); if (running) { // the watch has not been stopped formatElapsedTime(buff, getTime()); // add the current lap time too if there is more than one lap if (count >= 1) { buff.append(", count=").append(count); buff.append(", current="); formatElapsedTime(buff, getLapTime()); } } else { // the watch has been stopped formatElapsedTime(buff, getTime()); // add extra info if there is more than one lap if (count > 1) { buff.append(", count=").append(count); buff.append(", average="); formatElapsedTime(buff, getAverageLapTime()); } } return buff.toString(); }
public synchronized void reset() { this.watch.reset(); }
public int getLapCount() { return watch.getLapCount(); }
public synchronized long getTime() { return this.watch.getTime(); }
public boolean isRunning() { return watch.isRunning(); }
StopWatch watch = new StopWatch(true); msg.setUserData(new Long(watch.getLapTime())); sendNotification(msg); watch.stop();
public void reset() { watch.reset(); }
public synchronized int getLapCount() { return this.watch.getLapCount(); }
public long getTime() { return watch.getTime(); }
public synchronized boolean isRunning() { return this.watch.isRunning(); }
public long getLapTime() { return watch.getLapTime(); }
public synchronized long stop() { return this.watch.stop(); }
/** * Start the watch. * * @param reset True to reset the watch prior to starting. */ public void start(final boolean reset) { if (!running) { if (reset) reset(); start = System.currentTimeMillis(); running = true; } }
public long getAverageLapTime() { return watch.getAverageLapTime(); }
KernelEvent startEvent = new AbstractEvent(eventMgr, START_NOTIFICATION_TYPE, 0, System.currentTimeMillis(), new Long(watch.getLapTime())); eventMgr.fireKernelEvent(startEvent);