org.objectweb.proactive.core.util.timer
Class AverageMicroTimer

java.lang.Object
  extended byorg.objectweb.proactive.core.util.timer.AverageMicroTimer
All Implemented Interfaces:
java.io.Serializable, Timer
Direct Known Subclasses:
CompositeAverageMicroTimer, EWMATimer, TimerWithMemory

public class AverageMicroTimer
extends java.lang.Object
implements Timer, java.io.Serializable

Author:
Fabrice Huet
See Also:
Serialized Form

Field Summary
protected  long currentElapsed
           
protected  java.lang.String name
           
protected  int nbrValues
           
protected  boolean running
           
protected  MicroTimer timer
           
protected  long total
           
 
Constructor Summary
AverageMicroTimer()
           
AverageMicroTimer(java.lang.String name)
           
 
Method Summary
 void dump()
           
 double getAverage()
          return the average time measured so far
 long getCumulatedTime()
          returns the total time measured so far
 java.lang.String getName()
           
 int getNumberOfValues()
           
 void pause()
           
 void reset()
           
 void resume()
           
 void setName(java.lang.String name)
           
 void start()
           
 void stop()
          stop the timer and use the cumulated time to compute the average
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

name

protected java.lang.String name

nbrValues

protected int nbrValues

total

protected long total

currentElapsed

protected long currentElapsed

timer

protected transient MicroTimer timer

running

protected boolean running
Constructor Detail

AverageMicroTimer

public AverageMicroTimer()

AverageMicroTimer

public AverageMicroTimer(java.lang.String name)
Method Detail

start

public void start()
Specified by:
start in interface Timer

resume

public void resume()
Specified by:
resume in interface Timer

pause

public void pause()
Specified by:
pause in interface Timer

stop

public void stop()
stop the timer and use the cumulated time to compute the average

Specified by:
stop in interface Timer

getCumulatedTime

public long getCumulatedTime()
returns the total time measured so far

Specified by:
getCumulatedTime in interface Timer

getNumberOfValues

public int getNumberOfValues()
Specified by:
getNumberOfValues in interface Timer

getAverage

public double getAverage()
return the average time measured so far

Specified by:
getAverage in interface Timer
Returns:
the average time in microseconds -1 if NaN

dump

public void dump()
Specified by:
dump in interface Timer

toString

public java.lang.String toString()

getName

public java.lang.String getName()
Specified by:
getName in interface Timer

setName

public void setName(java.lang.String name)
Specified by:
setName in interface Timer

reset

public void reset()
Specified by:
reset in interface Timer


Copyright 2001-2005 INRIA All Rights Reserved.