Package featurecat.benchmark
Class Stopwatch
- java.lang.Object
-
- featurecat.benchmark.Stopwatch
-
public class Stopwatch extends java.lang.ObjectSimple stopwatch profiler to benchmark how long code takes to run
-
-
Constructor Summary
Constructors Constructor Description Stopwatch()Begins timing from the moment this object is created.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidlap(java.lang.String marker)Mark down the current time that it took $marker$ to run.voidprint()Print the recorded profiler statisticsvoidprintTimePerAction(int numActionsExecuted)voidreset()Reset the Stopwatch so it can be used again.
-
-
-
Method Detail
-
lap
public void lap(java.lang.String marker)
Mark down the current time that it took $marker$ to run.- Parameters:
marker- a tag to describe what section of code is being profiled
-
print
public void print()
Print the recorded profiler statistics
-
printTimePerAction
public void printTimePerAction(int numActionsExecuted)
-
reset
public void reset()
Reset the Stopwatch so it can be used again. Begins timing from the moment this method is executed.
-
-