Package org.apache.uima.internal.util
Class Timer
java.lang.Object
org.apache.uima.internal.util.Timer
Simple timer class.
-
Constructor Summary
-
Method Summary
-
Constructor Details
-
Timer
public Timer()Create a new timer. The new timer will NOT be started automatically. You need to invokestart()
explicitly.
-
-
Method Details
-
start
public boolean start()(Re)start the timer. If the timer has already been started, does nothing.- Returns:
false
iff the timer is already running.
-
stop
public boolean stop()Stop the timer.- Returns:
false
iff the timer is not running.
-
reset
public boolean reset()Reset the timer to 0. The timer must be stopped before it can be reset.- Returns:
false
iff the timer is currently running.
-
getTime
public long getTime()Get the currently accumulated time. This method may be called while the timer is running, or after it has been stopped.- Returns:
- The duration in milliseconds.
-
getTimeSpan
Get the accumulated time as a time span object.- Returns:
- A time span object for the current value of the timer.
- See Also:
-