Class Stopwatch

java.lang.Object
mpern.sap.commerce.build.util.Stopwatch

public class Stopwatch extends Object
Utility stopwatch.
  • Constructor Details

    • Stopwatch

      public Stopwatch()
      Construct and start the watch.
  • Method Details

    • stop

      public long stop()
      Stop the watch and return the duration in milliseconds.
      Returns:
      duration in milliseconds
    • getDurationInMs

      public long getDurationInMs()
      Gets the duration in milliseconds.
      Returns:
      duration in ms, -1 if the watch was not stopped
    • getDuration

      public long getDuration()
      Gets the duration in nanoseconds.
      Returns:
      duration in nanos, -1 if the watch was not stopped