| Modifier and Type | Class and Description |
|---|---|
| public static interface | Timer.
A timing context. |
| Modifier and Type | Method and Description |
|---|---|
| public long | |
| public Duration | Returns: the elapsed timedurationReturns the total elapsed timing durations of all completed timing events that are recorded with
|
| public Snapshot | getSnapshot()
Redeclares org. Returns a snapshot of the values. |
| public < the type of the value returned by T> Tevent | Returns: the value returned byeventa event)Callable whose Callable#call() method implements a process whose duration should be
timedTimes and records the duration of event. |
| public void | time(Runnable
a event)Runnable whose Runnable#run() method implements a process whose duration should be
timedTimes and records the duration of event. |
| public Timer. | |
| public void |
| getCount | back to summary |
|---|---|
| public long getCount() | |
| getElapsedTime | back to summary |
|---|---|
| public Duration getElapsedTime() Returns the total elapsed timing durations of all completed timing events that are recorded with
| |
| getSnapshot | back to summary |
|---|---|
| public Snapshot getSnapshot() Redeclares org. Doc from org. Returns a snapshot of the values. | |
| time | back to summary |
|---|---|
| public <T> T time(Callable<T> event) throws Exception Times and records the duration of event.
| |
| time | back to summary |
|---|---|
| public void time(Runnable event) Times and records the duration of event.
| |
| time | back to summary |
|---|---|
| public Timer. Returns a new | |
| update | back to summary |
|---|---|
| public void update(Duration duration) Adds a recorded duration. | |
Timer#time()
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public long | Returns: the elapsed time in nanosecondsUpdates the timer with the difference between current and start time. |
| close | back to summary |
|---|---|
| public void close() Redeclares java. Equivalent to calling
| |
| stop | back to summary |
|---|---|
| public long stop() Updates the timer with the difference between current and start time. Call to this method will not reset the start time. Multiple calls result in multiple updates.
| |