|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.shibboleth.utilities.java.support.chrono.Stopwatch
@NotThreadSafe public class Stopwatch
A stopwatch with millisecond precision.
| Field Summary | |
|---|---|
private long |
elapsedTime
Time that elapsed while the stopwatch was running. |
private Long |
startTime
Time the stopwatch was started. |
private Long |
stopTime
Time the stopwatch was stopped. |
| Constructor Summary | |
|---|---|
Stopwatch()
Constructor. |
|
Stopwatch(long startTimeInMillis)
Constructor. |
|
| Method Summary | |
|---|---|
long |
elapsedTime()
Time, in milliseconds, that elapsed while the stopwatch was running. |
long |
elapsedTime(TimeUnit unit)
Time, in the given time unit, that elapsed while the stopwatch was running. |
boolean |
isRunning()
Checks if the stopwatch is currently running. |
void |
reset()
Reset the stopwatch such that it is not running and no time has elapsed. |
void |
start()
Starts the stopwatch if it hasn't been started since being constructed or reset() was called. |
void |
stop()
Stops the stopwatch if it hasn't been stopped since being constructed or reset() was called. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private Long startTime
private Long stopTime
private long elapsedTime
| Constructor Detail |
|---|
public Stopwatch()
public Stopwatch(long startTimeInMillis)
startTimeInMillis - the time, in milliseconds since the epoch, when the stop watch started| Method Detail |
|---|
public long elapsedTime()
public long elapsedTime(@Nonnull
TimeUnit unit)
unit - time unit in which the result is returned
public boolean isRunning()
public void reset()
public void start()
reset() was called.
public void stop()
reset() was called.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||