public class RouterClock
extends net.i2p.util.Clock
| Modifier and Type | Class and Description |
|---|---|
static interface |
RouterClock.ClockShiftListener |
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_STRATUM |
| Constructor and Description |
|---|
RouterClock(RouterContext context)
Does not start.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addShiftListener(RouterClock.ClockShiftListener lsnr) |
long |
getDeltaOffset()
Deprecated.
|
net.i2p.time.Timestamper |
getTimestamper()
The RouterTimestamper
|
long |
now()
Retrieve the current time synchronized with whatever reference clock is in use.
|
void |
removeShiftListener(RouterClock.ClockShiftListener lsnr) |
void |
setNow(long realTime,
int stratum) |
void |
setOffset(long offsetMs,
boolean force)
Specify how far away from the "correct" time the computer is - a positive
value means that the system time is slow, while a negative value means the system time is fast.
|
void |
start()
Cannot be stopped, but RouterTimestamper registers a shutdown task.
|
public static final int DEFAULT_STRATUM
public RouterClock(RouterContext context)
public void start()
public net.i2p.time.Timestamper getTimestamper()
getTimestamper in class net.i2p.util.Clockpublic void setOffset(long offsetMs,
boolean force)
setOffset in class net.i2p.util.ClockoffsetMs - the delta from System.currentTimeMillis() (NOT the delta from now())public void setNow(long realTime,
int stratum)
setNow in interface net.i2p.time.Timestamper.UpdateListenersetNow in class net.i2p.util.Clockstratum - used to determine whether we should ignorepublic long now()
now in class net.i2p.util.Clockpublic void addShiftListener(RouterClock.ClockShiftListener lsnr)
public void removeShiftListener(RouterClock.ClockShiftListener lsnr)
@Deprecated public long getDeltaOffset()