Class IntervalTaskTimer
java.lang.Object
org.deltava.util.TaskTimer
org.deltava.util.IntervalTaskTimer
A Task Timer that allows multiple intervals to be recorded for different steps in an operation.
- Since:
- 11.1
- Version:
- 11.1
- Author:
- Luke
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlonggetInterval(String name) Returns the exectution time for a given marker.Returns the marker names.longMarks an interval without stopping the timer.voidstart()Starts the timer.longstop()End the timer.toString()
-
Constructor Details
-
IntervalTaskTimer
public IntervalTaskTimer()Creates and starts the timer.
-
-
Method Details
-
start
-
stop
-
mark
Marks an interval without stopping the timer. If a marker name is reused, the previous value will be overwritten.- Parameters:
name- the interval name- Returns:
- the current execution time, in nanoseconds
-
getMarkerNames
Returns the marker names.- Returns:
- a Collection of marker names
-
getInterval
Returns the exectution time for a given marker.- Parameters:
name- the marker name- Returns:
- the execution time in milliseconds, or -1 if the marker does not exist
-
toString
-