|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectutil.Launcher
public class Launcher
Resets state when multiple runs of the same piece of code are executed.
| Method Summary | |
|---|---|
void |
addStats(Statistics stat)
Adds statistics to current run |
long |
elapsedTime(boolean withoutGc)
Returns the wall-time of the most recently completed run with or without garbage collection time included |
static Launcher |
getLauncher()
|
Random |
getRandom(int seed)
Returns the random number generator for this run |
List<Statistics> |
getStatistics()
|
boolean |
isFirstRun()
|
void |
onRestart(Runnable callback)
Adds a callback to be called when launcher is reset. |
void |
reset()
Resets the launcher to its initial configuration in preparation for the next run. |
void |
startTiming()
Marks beginning of timed section. |
void |
stopTiming()
Marks end of timed section. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public void startTiming()
public void stopTiming()
public boolean isFirstRun()
public long elapsedTime(boolean withoutGc)
withoutGc - true if garbage collection time should be excluded from result
public void reset()
public List<Statistics> getStatistics()
public void onRestart(Runnable callback)
callback - callback to called on resetpublic void addStats(Statistics stat)
stat - the statistics to addpublic Random getRandom(int seed)
seed - the random number generator seed
public static Launcher getLauncher()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||