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:
- 12.3
- 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.toMap()Converts all of the timings to a Map.toString()Methods inherited from class TaskTimer
getEnd, getInterval, getMillis, getStart, isRunningModifier and TypeMethodDescriptionprotected longgetEnd()Returns the end time.longReturns the currently elapsed time without stopping the timer, if running.longReturns the execution time in milliseconds.protected longgetStart()Returns the start time.booleanReturns if the timer is currently running.
-
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
-
toMap
-
toString
-