|
Kodo 4.2.0. generated on July 28 2008 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.solarmetric.manage.TimeWatch
public class TimeWatch
A TimeWatch allows for marking code blocks and recording execution time statistics.
An example use would be:
TimeWatch tw = new TimeWatch (manager, "MyTimeWatch");
TimeWatch.Token token = tw.createToken ("namedBlock");
// do stuff to be timed.
token.stop ();
A more common use in Kodo would be:
KodoPersistenceManager kpm = ...;
TimeWatch tw = KodoTimeWatchManager.getTimeWatch (kpm);
TimeWatch.Token token = tw.createToken ("namedBlock");
// do stuff to be timed.
token.stop ();
Another typical use would be for timing iterations:
KodoPersistenceManager kpm = ...;
TimeWatch tw = KodoTimeWatchManager.getTimeWatch (kpm);
TimeWatch.Token token = tw.createToken ("namedBlock");
while (...)
{
// do stuff to be timed.
token.stop ();
}
Another typical use when timing iterations:
KodoPersistenceManager kpm = ...;
TimeWatch tw = KodoTimeWatchManager.getTimeWatch (kpm);
TimeWatch.Token token = tw.createToken ("namedBlock");
while (...)
{
// do stuff not to be timed.
token.restart ();
// do stuff to be timed.
token.stop ();
}
Nested Class Summary | |
---|---|
static class |
TimeWatch.Token
A timer token. |
Constructor Summary | |
---|---|
TimeWatch()
Create a new TimeWatch Watchable with the passed name. |
Method Summary | |
---|---|
boolean |
addListener(WatchableListener listener)
Add a listener. |
void |
clearListeners()
Clear all listeners. |
TimeWatch.Token |
createToken(String name)
Create a timer token. |
Collection |
getStatistics()
Get a collection of available statistics. |
boolean |
removeListener(WatchableListener listener)
Remove a listener. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TimeWatch()
Method Detail |
---|
public TimeWatch.Token createToken(String name)
public boolean addListener(WatchableListener listener)
addListener
in interface Watchable
public boolean removeListener(WatchableListener listener)
removeListener
in interface Watchable
public void clearListeners()
clearListeners
in interface Watchable
public Collection getStatistics()
getStatistics
in interface Watchable
|
Kodo 4.2.0. generated on July 28 2008 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |