Back to Exoplayer

Clock (ExoPlayer library)

docs/doc/reference/com/google/android/exoplayer2/util/Clock.html

latest4.4 KB
Original Source

Package com.google.android.exoplayer2.util

Interface Clock

  • All Known Implementing Classes:FakeClock, SystemClock

[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public interfaceClock

Deprecated. com.google.android.exoplayer2 is deprecated. Please migrate to androidx.media3 (which contains the same ExoPlayer code). See the migration guide for more details, including a script to help with the migration.

An interface through which system clocks can be read and HandlerWrappers created. The DEFAULT implementation must be used for all non-test cases.

Field Summary

Fields | Modifier and Type | Field | Description | | --- | --- | --- | | static Clock | DEFAULT | Deprecated.

Default Clock to use for all non-test cases. |

Method Summary

All Methods Instance Methods Abstract Methods Deprecated Methods | Modifier and Type | Method | Description | | --- | --- | --- | | HandlerWrapper | createHandler​(Looper looper, Handler.Callback callback) | Deprecated.

Creates a HandlerWrapper using a specified looper and a specified callback for handling messages. | | long | currentTimeMillis() | Deprecated.

Returns the current time in milliseconds since the Unix Epoch. | | long | elapsedRealtime() | Deprecated. | | long | nanoTime() | Deprecated.

See System.nanoTime() | | void | onThreadBlocked() | Deprecated.

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 | uptimeMillis() | Deprecated. |

Field Detail

- 

DEFAULT

static final[Clock](Clock.html "interface in com.google.android.exoplayer2.util")DEFAULT

Deprecated.

Default Clock to use for all non-test cases.

Method Detail

- 

currentTimeMillis

long currentTimeMillis()

Deprecated.

Returns the current time in milliseconds since the Unix Epoch. See Also:System.currentTimeMillis()

- 

elapsedRealtime

long elapsedRealtime()

Deprecated. See Also:SystemClock.elapsedRealtime()

- 

uptimeMillis

long uptimeMillis()

Deprecated. See Also:SystemClock.uptimeMillis()

- 

nanoTime

long nanoTime()

Deprecated.

See System.nanoTime()

- 

createHandler

[HandlerWrapper](HandlerWrapper.html "interface in com.google.android.exoplayer2.util")createHandler​([Looper](https://developer.android.com/reference/android/os/Looper.html "class or interface in android.os")looper,
                             @Nullable[Handler.Callback](https://developer.android.com/reference/android/os/Handler.Callback.html "class or interface in android.os")callback)

Deprecated.

Creates a HandlerWrapper using a specified looper and a specified callback for handling messages. See Also:Handler(Looper, Handler.Callback)

- 

onThreadBlocked

void onThreadBlocked()

Deprecated.

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.