public class StopWatch extends Object
Tracking the method invoke cost, thread-safe, but in multi-thread, the invoke relation is crossed over. Tree-like invoke relations are represented consistent with call stack in linear try-close calls.
| Modifier and Type | Class and Description |
|---|---|
static class |
StopWatch.Watch |
| Constructor and Description |
|---|
StopWatch() |
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
clear all time watch
|
ConcurrentLinkedQueue<StopWatch.Watch> |
getWatches()
get all time watches
|
boolean |
isRunning()
whether is in any time watch
|
StopWatch.Watch |
start(String name)
start a time watch
|
String |
toString() |
long |
totalElapse()
get the top Elapse in nanos
|
public StopWatch.Watch start(String name)
public void clear()
public boolean isRunning()
public ConcurrentLinkedQueue<StopWatch.Watch> getWatches()
public long totalElapse()
Copyright © 2023. All rights reserved.