Package featurecat.benchmark
Class Stopwatch
- java.lang.Object
-
- featurecat.benchmark.Stopwatch
-
public class Stopwatch extends Object
Simple 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 void
lap(String marker)
Mark down the current time that it took $marker$ to run.void
print()
Print the recorded profiler statisticsvoid
printTimePerAction(int numActionsExecuted)
void
reset()
Reset the Stopwatch so it can be used again.
-
-
-
Method Detail
-
lap
public void lap(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.
-
-