Package mpern.sap.commerce.build.util
Class Stopwatch
java.lang.Object
mpern.sap.commerce.build.util.Stopwatch
Utility stopwatch.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongGets the duration in nanoseconds.longGets the duration in milliseconds.longstop()Stop the watch and return the duration in milliseconds.
-
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
-