|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.google.common.base.Ticker
com.google.common.testing.FakeTicker
@Beta @GwtCompatible public class FakeTicker
A Ticker whose value can be advanced programmatically in test.
This class is thread-safe.
Constructor Summary | |
---|---|
FakeTicker()
|
Method Summary | |
---|---|
FakeTicker |
advance(long nanoseconds)
Advances the ticker value by nanoseconds . |
FakeTicker |
advance(long time,
TimeUnit timeUnit)
Advances the ticker value by time in timeUnit . |
long |
read()
Returns the number of nanoseconds elapsed since this ticker's fixed point of reference. |
Methods inherited from class com.google.common.base.Ticker |
---|
systemTicker |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FakeTicker()
Method Detail |
---|
public FakeTicker advance(long time, TimeUnit timeUnit)
time
in timeUnit
.
public FakeTicker advance(long nanoseconds)
nanoseconds
.
public long read()
Ticker
read
in class Ticker
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |