Class Stopwatch

java.lang.Object
  extended by Stopwatch

public class Stopwatch
extends java.lang.Object

General purpose Stopwatch class for timing code execution


Field Summary
private  boolean running
           
private  long startTime
           
private  long stopTime
           
 
Constructor Summary
Stopwatch()
           
 
Method Summary
(package private)  long getElapsedTime()
          Get the elapsed time in ms
(package private)  Stopwatch reset()
          Reset the stopwatch
(package private)  Stopwatch start()
          Start the stopwatch
(package private)  Stopwatch stop()
          Stop the watch
 java.lang.String toString()
          Provide a string representation of the stopwatch object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

startTime

private long startTime

stopTime

private long stopTime

running

private boolean running
Constructor Detail

Stopwatch

public Stopwatch()
Method Detail

start

Stopwatch start()
Start the stopwatch

Returns:
This object

stop

Stopwatch stop()
Stop the watch

Returns:
This object

getElapsedTime

long getElapsedTime()
Get the elapsed time in ms

Returns:
The elapsed time in ms

reset

Stopwatch reset()
Reset the stopwatch

Returns:
This object

toString

public java.lang.String toString()
Provide a string representation of the stopwatch object

Overrides:
toString in class java.lang.Object
Returns:
The string representation of the stopwatch