Methods Summary |
---|
public double | getAverageTime()
if (this.numLaps == 0) {
return getElapsedTime();
}
return (double) getElapsedTime() / (double) numLaps;
|
public long | getElapsedTime()
if (this.running) {
return System.currentTimeMillis() - this.startTime;
}
return this.stopTime - this.startTime;
|
public void | lap()
this.numLaps++;
|
public void | start()
this.running = true;
this.numLaps = 0;
this.startTime = System.currentTimeMillis();
|
public void | stop()
this.stopTime = System.currentTimeMillis();
this.running = false;
|
public java.lang.String | toString()
return getElapsedTime() + "ms";
|