Clock
@UnstableApi
public interface Clock
FakeClock |
Fake |
SystemClock |
The standard implementation of |
An interface through which system clocks can be read and HandlerWrappers created. The DEFAULT implementation must be used for all non-test cases.
Summary
Public methods |
|
|---|---|
abstract HandlerWrapper |
createHandler(Creates a |
abstract long |
Returns the current time in milliseconds since the Unix Epoch. |
abstract long |
|
abstract long |
nanoTime()See |
abstract void |
Notifies the clock that the current thread is about to be blocked and won't return until a condition on another thread becomes true. |
abstract long |
Public methods
createHandler
abstract HandlerWrapper createHandler(
Looper looper,
@Nullable @UnknownInitialization Handler.Callback callback
)
Creates a HandlerWrapper using a specified looper and a specified callback for handling messages.
| See also | |
|---|---|
Handler |
currentTimeMillis
abstract long currentTimeMillis()
Returns the current time in milliseconds since the Unix Epoch.
| See also | |
|---|---|
currentTimeMillis |
onThreadBlocked
abstract 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.