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 Details

    • Stopwatch

      public Stopwatch()
      Begins timing from the moment this object is created.
  • Method Details

    • 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.