@UnstableApi
class SystemClock : Clock


The standard implementation of Clock, an instance of which is available via DEFAULT.

Summary

Protected constructors

Public functions

HandlerWrapper!
createHandler(looper: Looper!, callback: Handler.Callback?)

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

Unit

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
const Clock!

Default Clock to use for all non-test cases.

Protected constructors

SystemClock

protected SystemClock()

Public functions

createHandler

fun createHandler(looper: Looper!, callback: Handler.Callback?): HandlerWrapper!

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

See also
Handler

currentTimeMillis

fun currentTimeMillis(): Long

Returns the current time in milliseconds since the Unix Epoch.

elapsedRealtime

fun elapsedRealtime(): Long
See also
elapsedRealtime

nanoTime

fun nanoTime(): Long

See nanoTime

onThreadBlocked

fun onThreadBlocked(): Unit

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

fun uptimeMillis(): Long
See also
uptimeMillis