@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

Creates a HandlerWrapper using a specified looper and a specified callback for handling messages.

long

Returns the current time in milliseconds since the Unix Epoch.

long
long

See nanoTime

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

Inherited Constants

From androidx.media3.common.util.Clock
static final Clock

Default Clock to use for all non-test cases.

Protected constructors

SystemClock

protected SystemClock()

Public methods

createHandler

public HandlerWrapper createHandler(Looper looper, @Nullable 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.

elapsedRealtime

public long elapsedRealtime()
See also
elapsedRealtime

nanoTime

public long nanoTime()

See nanoTime

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.

uptimeMillis

public long uptimeMillis()
See also
uptimeMillis