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:
@@ -179,14 +179,17 @@ public class Invoker extends LoopingThread
|
|||||||
/** Used to track profile information on invoked units. */
|
/** Used to track profile information on invoked units. */
|
||||||
protected static class UnitProfile
|
protected static class UnitProfile
|
||||||
{
|
{
|
||||||
public void record (long duration)
|
public void record (long duration) {
|
||||||
{
|
|
||||||
_totalElapsed += duration;
|
_totalElapsed += duration;
|
||||||
_histo.addValue((int)duration);
|
_histo.addValue((int)duration);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String toString ()
|
public void clear () {
|
||||||
{
|
_totalElapsed = 0L;
|
||||||
|
_histo.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String toString () {
|
||||||
int count = _histo.size();
|
int count = _histo.size();
|
||||||
return _totalElapsed + "ms/" + count + " = " +
|
return _totalElapsed + "ms/" + count + " = " +
|
||||||
(_totalElapsed/count) + "ms avg " +
|
(_totalElapsed/count) + "ms avg " +
|
||||||
|
|||||||
Reference in New Issue
Block a user