Package com.activeviam.time
Interface ITimeSupplier
-
- All Known Implementing Classes:
SystemTimeSupplier
public interface ITimeSupplierAn object providing a representation of the time. It is supposed to provide system current time in core functions and can be replaced by a "by hand increased" time abstraction in tests.- Author:
- ActiveViam
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description longcurrentTimeMillis()Returns the current time with respect to the current instance.voidsleep(long time)Waits for time to increase by a prescribed amount.
-
-
-
Method Detail
-
currentTimeMillis
long currentTimeMillis()
Returns the current time with respect to the current instance.Warning: this clock can be non-monotonic.
- Returns:
- the current time in milliseconds
-
sleep
void sleep(long time) throws InterruptedExceptionWaits for time to increase by a prescribed amount.- Parameters:
time- amount of time to wait for in milliseconds- Throws:
InterruptedException- if any thread has interrupted the current thread
-
-