@ParametersAreNonnullByDefault public final class Stopwatch extends Object
Instant.| Modifier and Type | Method and Description |
|---|---|
static Stopwatch |
createStarted()
Creates (and starts) a new stopwatch.
|
static Stopwatch |
createUnstarted()
Creates (but does not start) a new stopwatch.
|
Duration |
elapsed()
Returns the current elapsed time shown on this stopwatch.
|
boolean |
isRunning()
Checks whether this stopwatch is currently running.
|
Stopwatch |
reset()
Sets the elapsed time for this stopwatch to
0, and places it in a stopped state. |
Stopwatch |
start()
Starts this stopwatch.
|
Stopwatch |
stop()
Stops this stopwatch.
|
@Nonnull public static Stopwatch createUnstarted()
@Nonnull public static Stopwatch createStarted()
public boolean isRunning()
@Nonnull public Stopwatch start()
IllegalStateException - if this stopwatch is already running@Nonnull public Stopwatch stop()
IllegalStateException - if this stopwatch is already stopped@Nonnull public Stopwatch reset()
0, and places it in a stopped state.Copyright © 2017–2019 Atlanmod. All rights reserved.