Interface Clock
-
- All Known Implementing Classes:
FakeClock,SystemClock
public interface ClockAn interface through which system clocks can be read andHandlerWrappers created. TheDEFAULTimplementation must be used for all non-test cases.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description HandlerWrappercreateHandler(Looper looper, Handler.Callback callback)Creates aHandlerWrapperusing a specified looper and a specified callback for handling messages.longcurrentTimeMillis()Returns the current time in milliseconds since the Unix Epoch.longelapsedRealtime()voidonThreadBlocked()Notifies the clock that the current thread is about to be blocked and won't return until a condition on another thread becomes true.longuptimeMillis()
-
-
-
Method Detail
-
currentTimeMillis
long currentTimeMillis()
Returns the current time in milliseconds since the Unix Epoch.- See Also:
System.currentTimeMillis()
-
elapsedRealtime
long elapsedRealtime()
- See Also:
SystemClock.elapsedRealtime()
-
uptimeMillis
long uptimeMillis()
- See Also:
SystemClock.uptimeMillis()
-
createHandler
HandlerWrapper createHandler(Looper looper, @Nullable Handler.Callback callback)
Creates aHandlerWrapperusing a specified looper and a specified callback for handling messages.- See Also:
Handler(Looper, Handler.Callback)
-
onThreadBlocked
void onThreadBlocked()
Notifies the clock that the current thread is about to be blocked and won't return until a condition on another thread becomes true.Should be a no-op for all non-test cases.
-
-