public class RuntimeTracker
extends Object
RuntimeTracker Object should be created at least with a name.
It also supports a user case of RuntimeTrackerTree instance for runtime analysis of an entire program.| Constructor and Description |
|---|
RuntimeTracker(String name) |
RuntimeTracker(String name,
short level) |
| Modifier and Type | Method and Description |
|---|---|
void |
addChild(RuntimeTracker runtimeTracker)
Adds a child runtime tracker.
|
static long |
elapsed(long start) |
List<RuntimeTracker> |
getChildren()
Gets the child runtime trackers.
|
short |
getLevel()
Gets the level of a RuntimeTracker instance.
|
String |
getName()
Gets the runtime tracker name.
|
long |
getTime()
Gets the total time elapsed in nanoseconds.
|
int |
hashCode() |
static long |
now() |
void |
setLevel(short level)
Sets the level (depth) of a RuntimeTracker instance if it is included in a tree.
|
void |
setTime(long time)
Sets the total time.
|
void |
start() |
void |
stop()
Stops the runtime tracker and stores the total time elapsed in nanoseconds.
|
String |
toString() |
String |
trackerWithOneLevelChidren()
Returns a string representing a runtime tracker and its child trackers.
|
String |
trakerWithFullHierarchy()
Returns a string that represents the full hierarchy of a runtime tracker,
including all the downhill runtime trackers to the leaf runtime trackers.
|
public RuntimeTracker(String name)
public RuntimeTracker(String name,
short level)
public short getLevel()
public void setLevel(short level)
level - public List<RuntimeTracker> getChildren()
public void addChild(RuntimeTracker runtimeTracker)
runtimeTracker - The child runtime tracker.public static long now()
public static long elapsed(long start)
public void start()
public void stop()
public void setTime(long time)
time - public long getTime()
public String getName()
public int hashCode()
hashCode in class Objectpublic String toString()
toString in class Objectpublic String trakerWithFullHierarchy()
public String trackerWithOneLevelChidren()