SystemClock
@UnstableApi
public class SystemClock implements Clock
The standard implementation of Clock, an instance of which is available via DEFAULT.
Summary
Protected constructors |
|---|
Public methods |
|
|---|---|
HandlerWrapper |
createHandler(Creates a |
long |
Returns the current time in milliseconds since the Unix Epoch. |
long |
|
long |
nanoTime()See |
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. |
long |
Protected constructors
Public methods
createHandler
public HandlerWrapper createHandler(
Looper looper,
@UnknownInitialization @Nullable @UnknownInitialization Handler.Callback callback
)
Creates a HandlerWrapper using a specified looper and a specified callback for handling messages.
| See also | |
|---|---|
Handler |
currentTimeMillis
public long currentTimeMillis()
Returns the current time in milliseconds since the Unix Epoch.
| See also | |
|---|---|
currentTimeMillis |
onThreadBlocked
public 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.