## net.i2p.router
Class RouterClock

    java.lang.Object
      net.i2p.util.Clock
          net.i2p.router.RouterClock

All Implemented Interfaces:
  Timestamper.UpdateListener

    public class RouterClock

extends Clock

Alternate location for determining the time which takes into account an offset. This offset will ideally be periodically updated so as to serve as the difference between the local computer's current time and the time as known by some reference (such as an NTP synchronized clock). RouterClock is a subclass of Clock with access to router transports. Configuration permitting, it will block clock offset changes which would increase peer clock skew.

Nested Class Summary

Nested classes/interfaces inherited from class net.i2p.util.Clock
`Clock.ClockUpdateListener`

Field Summary
`(package private) RouterContext` `_context`

Fields inherited from class net.i2p.util.Clock
`_alreadyChanged, _offset, _startedOn, _statCreated, MAX_LIVE_OFFSET, MAX_OFFSET, MIN_OFFSET_CHANGE`

Constructor Summary
`RouterClock(RouterContext context)`

Method Summary
`void` `setOffset(long offsetMs, boolean force)` Specify how far away from the "correct" time the computer is - a positive value means that we are slow, while a negative value means we are fast.

Methods inherited from class net.i2p.util.Clock
`addUpdateListener, fireOffsetChanged, getInstance, getLog, getOffset, getTimestamper, getUpdatedSuccessfully, now, removeUpdateListener, setNow, setOffset`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### _context

    RouterContext _context

Constructor Detail

### RouterClock

    public RouterClock(RouterContext context)

Method Detail

### setOffset

    public void setOffset(long offsetMs,
                          boolean force)

  Specify how far away from the "correct" time the computer is - a positive value means that we are slow, while a negative value means we are fast.

  Overrides:
    `setOffset` in class `Clock`