|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectse.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
License
,
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. |
(package private) static long |
REL_TIME
|
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 second. |
Method Summary | |
long |
millis(long timestamp)
Express the time stamp (number of ticks) in milli-seconds. |
long |
nanos(long timestamp)
Express the time stamp 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 time stamp (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 Timebase envTimebase
protected final int milliRate
protected final int nanoRate
protected final int rate
static final long REL_TIME
protected final double scale
protected final long start
Constructor Detail |
public Timebase()
public Timebase(long origin, long pace)
origin
and with pace
system dependent ticks per second.
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 long millis(long timestamp)
public long nanos(long timestamp)
public long pace()
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-aware robots, etc.
java.lang.IllegalStateException
seconds(long)
public double seconds(long timestamp)
public long time0()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |