Package de.uplanet.util
Class Stopwatch
java.lang.Object
de.uplanet.util.Stopwatch
Stopwatch with millisecond time resolution.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
MILLIS
public static final long MILLIS- See Also:
-
MICROS
public static final long MICROS- See Also:
-
NANOS
public static final long NANOS- See Also:
-
-
Constructor Details
-
Stopwatch
public Stopwatch()Create a stopwatch with millisecond resolution. -
Stopwatch
public Stopwatch(long p_lResolution) Create a stopwatch with a given resolution. -
Stopwatch
Create a stopwatch with a given resolution.- Parameters:
p_timeUnit
- The resolution.
-
-
Method Details
-
start
Start the stopwatch.- Returns:
- This stopwatch.
-
stop
public long stop()Get the meantime in the time unit given to the constructor.- Returns:
- The meantime.
-
restart
public long restart()Get the meantime in the time unit given to the constructor and reset to zero.- Returns:
- The meantime.
-