cz.cuni.pogamut.experiments
Class TimeProvider

java.lang.Object
  extended by cz.cuni.pogamut.experiments.TimeProvider

public class TimeProvider
extends java.lang.Object

TimeProvider has to be separate class, if it was part of the Experiment class it would cause problems with garbage collection. TimeProvider is alfo refecenced from Timer.


Field Summary
protected  boolean running
          Is the timer running?
protected  long simulationTime
          Time of simulation, paused when simulation is paused.
protected  long sysTimeOfLastEvent
          Time when this timer was last resumed.
protected  long timeOfStart
          Sys time when this experiment has started.
 
Constructor Summary
TimeProvider(Experiment experiment)
           
 
Method Summary
 long getSimulationTime()
           
 long getSystemTime()
           
 boolean isRunning()
           
 void startTime()
           
 void stopTime()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

simulationTime

protected long simulationTime
Time of simulation, paused when simulation is paused.


sysTimeOfLastEvent

protected long sysTimeOfLastEvent
Time when this timer was last resumed.


running

protected boolean running
Is the timer running?


timeOfStart

protected long timeOfStart
Sys time when this experiment has started.

Constructor Detail

TimeProvider

public TimeProvider(Experiment experiment)
Parameters:
experiment - Experiment for which this object will provide time.
Method Detail

stopTime

public void stopTime()

startTime

public void startTime()

getSimulationTime

public long getSimulationTime()
Returns:
Simulation time elapsed since creation of this time provider. getSystemTime() >= getSimulationTime()

getSystemTime

public long getSystemTime()
Returns:
System time elapsed since creation of this time provider. getSystemTime() >= getSimulationTime()

isRunning

public boolean isRunning()