Class SystemClock
- java.lang.Object
-
- com.google.android.exoplayer2.util.SystemClock
-
- All Implemented Interfaces:
Clock
public class SystemClock extends Object implements Clock
The standard implementation ofClock, an instance of which is available viaClock.DEFAULT.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedSystemClock()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description HandlerWrappercreateHandler(Looper looper, Handler.Callback callback)Creates aHandlerWrapperusing a specified looper and a specified callback for handling messages.longcurrentTimeMillis()Returns the current time in milliseconds since the Unix Epoch.longelapsedRealtime()voidonThreadBlocked()Notifies the clock that the current thread is about to be blocked and won't return until a condition on another thread becomes true.longuptimeMillis()
-
-
-
Method Detail
-
currentTimeMillis
public long currentTimeMillis()
Description copied from interface:ClockReturns the current time in milliseconds since the Unix Epoch.- Specified by:
currentTimeMillisin interfaceClock- See Also:
System.currentTimeMillis()
-
elapsedRealtime
public long elapsedRealtime()
- Specified by:
elapsedRealtimein interfaceClock- See Also:
SystemClock.elapsedRealtime()
-
uptimeMillis
public long uptimeMillis()
- Specified by:
uptimeMillisin interfaceClock- See Also:
SystemClock.uptimeMillis()
-
createHandler
public HandlerWrapper createHandler(Looper looper, @Nullable Handler.Callback callback)
Description copied from interface:ClockCreates aHandlerWrapperusing a specified looper and a specified callback for handling messages.- Specified by:
createHandlerin interfaceClock- See Also:
Handler(Looper, Handler.Callback)
-
onThreadBlocked
public void onThreadBlocked()
Description copied from interface:ClockNotifies 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.
- Specified by:
onThreadBlockedin interfaceClock
-
-