|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.realtime.Clock
javax.realtime.RealtimeClock
The class RealtimeClock provides access to the
"Wall-Clock" time. In the current implementation the resolution of
the clock is of the order of microseconds.
Implementation Note: This class is implemented by using the
method call gettimeofday, so it has a resolution that
depends on the resolution guaranteed by the underlying OS. If you
need to make real fine grain time measurement than you should use
that class HighResolutionClock. This class provide
nanosecond time accuracy in most plaform.
HighResolutionClock| Method Summary | |
RelativeTime |
getEpochOffset()
Gets the relative time of the offset of the epoch of this Clock from the Epoch. |
RelativeTime |
getResolution()
Return the resolution of the clock -- the interval between ticks. |
AbsoluteTime |
getTime()
Return the current time in a freshly allocated object. |
AbsoluteTime |
getTime(AbsoluteTime time)
Return the current time in an existing object. |
static RealtimeClock |
instance()
Get the singleton instance of RealtimeClock. |
void |
setResolution(RelativeTime resolution)
Set the resolution of this. |
| Methods inherited from class javax.realtime.Clock |
getRealtimeClock |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
public static RealtimeClock instance()
RealtimeClock.
RealtimeClockpublic RelativeTime getEpochOffset()
Clock from the Epoch. This clock implementation
returns RelativeTime(0,0) in accordance
with the spec.
getEpochOffset in class ClockRelativeTime object
representing the offset of the epoch; the returned object is
associated with this Clockpublic RelativeTime getResolution()
getResolution in class Clockpublic void setResolution(RelativeTime resolution)
setResolution in class Clockresolution - The new resolution of this.public AbsoluteTime getTime()
getTime in class Clockpublic AbsoluteTime getTime(AbsoluteTime time)
getTime in class Clocktime - The AbsoluteTime object which will have its
time changed; if null, this call has no effect
time
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||