|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--se.lth.cs.realtime.Timebase
The time-base class, mapping ticks to time. This class is needed for the following reasons:
envTimebase
) but that is not yet supported.
javax.media.TimeBase
,
RTEvent
Field Summary | |
protected Timebase |
envTimebase
The time base of the surrounding system, such as the real world. |
protected int |
milliRate
Ticks per milli-second. |
protected int |
nanoRate
Ticks per nano-seconds. |
protected int |
rate
Ticks per second. |
protected double |
scale
Seconds per tick. |
protected long |
start
The start of time, in milliseconds relative to beginning of 1970. |
Constructor Summary | |
Timebase()
Constructor for default system time, using ticks for milli-seconds from beginning of 1970 as for System.currentTimeMillis(). |
|
Timebase(long origin,
long pace)
Constructor for a time base starting with time zero at origin
and with pace system dependent ticks per milliseconds. |
Method Summary | |
long |
millis(long timestamp)
Express the timestamp (number of ticks) in milli-seconds. |
long |
nanos(long timestamp)
Express the timestamp in nano-seconds. |
long |
pace()
Rate of clock ticks per second. |
double |
physicalSeconds(long timestamp)
Obtain physical real-world time. |
double |
seconds(long timestamp)
Express the timestamp (that is, number of clock ticks) in seconds. |
long |
time0()
The start of this time base, possibly relative to an enclosing time base, and expressed in seconds from beginning 1970. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected final long start
protected final double scale
protected final int rate
protected final int milliRate
protected final int nanoRate
protected Timebase envTimebase
Constructor Detail |
public Timebase()
public Timebase(long origin, long pace)
origin
and with pace
system dependent ticks per milliseconds.
To represent the time in an embedded controller without battery supported
clock (time realative to start of system) use REL_TIME
as
the origin
argument.Method Detail |
public double physicalSeconds(long timestamp) throws java.lang.IllegalStateException
seconds
;
that method should be used except in special cases of simulation, any-time
algorithms, self-contioness robots, etc.seconds(long)
public double seconds(long timestamp)
public long millis(long timestamp)
public long nanos(long timestamp)
public long time0()
public long pace()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |