public class Stopwatch
extends java.lang.Object
Constructor and Description |
---|
Stopwatch() |
Modifier and Type | Method and Description |
---|---|
long |
getMilliseconds()
Returns the duration of the stopwatch as a long, in milliseconds.
|
double |
getMinutes()
Returns the duration of the stopwatch as a double, in minutes.
|
double |
getSeconds()
Returns the duration of the stopwatch as a double, in seconds.
|
boolean |
isGoing()
Returns whether or not the stopwatch is currently active (has been started but not stopped since the most recent start() call)
|
void |
reset()
Stops the stopwatch and resets the duration back to 0.
|
void |
restart()
Restarts the stopwatch by calling reset() and then start().
|
void |
start()
Starts the stopwatch.
|
void |
stop()
Stops the stopwatch.
|
public void start()
public void stop()
public void reset()
public void restart()
public long getMilliseconds()
public double getSeconds()
public double getMinutes()
public boolean isGoing()