Package com.yahoo.jdisc.test
Class TestTimer
- java.lang.Object
-
- com.yahoo.jdisc.test.TestTimer
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.yahoo.jdisc.Timer
Timer.ClockAdapter
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
advance(Duration duration)
void
advanceMillis(long millis)
void
advanceMinutes(long minutes)
void
advanceSeconds(long seconds)
Instant
currentTime()
Convenience method for getting an java.util.Instance from currentTimeMillis().long
currentTimeMillis()
Returns the current time in milliseconds.void
setMillis(long millisSinceEpoch)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.yahoo.jdisc.Timer
toUtcClock
-
-
-
-
Constructor Detail
-
TestTimer
public TestTimer()
-
TestTimer
public TestTimer(Instant instant)
-
-
Method Detail
-
setMillis
public void setMillis(long millisSinceEpoch)
-
advanceMillis
public void advanceMillis(long millis)
-
advanceSeconds
public void advanceSeconds(long seconds)
-
advanceMinutes
public void advanceMinutes(long minutes)
-
advance
public void advance(Duration duration)
-
currentTime
public Instant currentTime()
Description copied from interface:Timer
Convenience method for getting an java.util.Instance from currentTimeMillis().- Specified by:
currentTime
in interfaceTimer
-
currentTimeMillis
public long currentTimeMillis()
Description copied from interface:Timer
Returns the current time in milliseconds. Note that while the unit of time of the return value is a millisecond, the granularity of the value depends on the underlying operating system and may be larger. For example, many operating systems measure time in units of tens of milliseconds.
See the description of the class
Date
for a discussion of slight discrepancies that may arise between "computer time" and coordinated universal time (UTC).- Specified by:
currentTimeMillis
in interfaceTimer
- Returns:
- The difference, measured in milliseconds, between the current time and midnight, January 1, 1970 UTC.
- See Also:
Date
-
-