public class Stopwatch extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Stopwatch.StopwatchState
This is the object that maintains our state on the thread local storage
|
| Modifier and Type | Field and Description |
|---|---|
static String |
ISO_FORMAT |
static SimpleDateFormat |
isoFormatter |
static TimeZone |
utc |
| Constructor and Description |
|---|
Stopwatch() |
| Modifier and Type | Method and Description |
|---|---|
static void |
clear()
Clears (and possibly stops) the watch.
|
static double |
getCurrentDuration()
Gets the amount of time since the stop watch was last started without stopping the watch or accumulating the
previous time.
|
static long |
getDuration()
The accumulated duration of the watch (in nano-seconds)
|
static boolean |
isRunning()
Determines if the stopwatch is currently running or not
|
static void |
start()
Starts the watch if not already running.
|
static void |
stop()
Stops the accumulation of time on the watch if running
|
public static String ISO_FORMAT
public static final TimeZone utc
public static final SimpleDateFormat isoFormatter
public static void clear()
public static long getDuration()
public static boolean isRunning()
public static void start()
public static void stop()
public static double getCurrentDuration()
Copyright © 2019. All rights reserved.