|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.ros.time.NtpTimeProvider
public class NtpTimeProvider
Provides NTP synchronized wallclock (actual) time.
Constructor Summary | |
---|---|
NtpTimeProvider(java.net.InetAddress host,
java.util.concurrent.ScheduledExecutorService scheduledExecutorService)
|
Method Summary | |
---|---|
Time |
getCurrentTime()
|
void |
startPeriodicUpdates(long period,
java.util.concurrent.TimeUnit unit)
Starts periodically updating the current time offset periodically. |
void |
stopPeriodicUpdates()
Stops periodically updating the current time offset. |
void |
updateTime()
Update the current time offset from the configured NTP host. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public NtpTimeProvider(java.net.InetAddress host, java.util.concurrent.ScheduledExecutorService scheduledExecutorService)
host
- the NTP host to useMethod Detail |
---|
public void updateTime() throws java.io.IOException
java.io.IOException
public void startPeriodicUpdates(long period, java.util.concurrent.TimeUnit unit)
The first time update happens immediately.
Note that errors thrown while periodically updating time will be logged but not rethrown.
period
- time between updatesunit
- unit of periodpublic void stopPeriodicUpdates()
public Time getCurrentTime()
getCurrentTime
in interface TimeProvider
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |