Package featurecat.benchmark
Class Stopwatch
java.lang.Object
featurecat.benchmark.Stopwatch
Simple stopwatch profiler to benchmark how long code takes to run
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
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.
-
Constructor Details
-
Stopwatch
public Stopwatch()Begins timing from the moment this object is created.
-
-
Method Details
-
lap
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.
-