Package org.apache.activemq.util
Class StopWatch
java.lang.Object
org.apache.activemq.util.StopWatch
A very simple stop watch.
This implementation is not thread safe and can only time one task at any given time.
-
Constructor Summary
-
Method Summary
-
Constructor Details
-
StopWatch
public StopWatch()Starts the stop watch -
StopWatch
public StopWatch(boolean started) Creates the stop watch- Parameters:
started
- whether it should start immediately
-
-
Method Details
-
restart
public void restart()Starts or restarts the stop watch -
stop
public long stop()Stops the stop watch- Returns:
- the time taken in milliseconds.
-
taken
public long taken()Returns the time taken in milliseconds.- Returns:
- time in milliseconds
-