Added the ability to clear a unit profile.

git-svn-id: https://samskivert.googlecode.com/svn/trunk@1578 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
mdb
2005-01-24 17:15:40 +00:00
parent bd11a19d15
commit 573ce7859b
@@ -179,14 +179,17 @@ public class Invoker extends LoopingThread
/** Used to track profile information on invoked units. */
protected static class UnitProfile
{
public void record (long duration)
{
public void record (long duration) {
_totalElapsed += duration;
_histo.addValue((int)duration);
}
public String toString ()
{
public void clear () {
_totalElapsed = 0L;
_histo.clear();
}
public String toString () {
int count = _histo.size();
return _totalElapsed + "ms/" + count + " = " +
(_totalElapsed/count) + "ms avg " +