Package org.apache.camel.util
Class StopWatch
java.lang.Object
org.apache.camel.util.StopWatch
A very simple stop watch.
This implementation is not thread safe and can only time one task at any given time.
-
Constructor Details
-
StopWatch
public StopWatch()Starts the stop watch -
StopWatch
Starts the stop watch from the given timestamp -
StopWatch
Creates the stop watch- Parameters:
start
- whether it should start immediately
-
-
Method Details
-
restart
Starts or restarts the stop watch -
isStarted
Whether the watch is started -
taken
Returns the time taken in millis.- Returns:
- time in millis, or 0 if not started yet.
-
takenAndRestart
Returns the time taken in millis and restarts the timer.- Returns:
- time in millis, or 0 if not started yet.
-