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 protected
SystemClock()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description HandlerWrapper
createHandler(Looper looper, Handler.Callback callback)
Creates aHandlerWrapper
using a specified looper and a specified callback for handling messages.long
currentTimeMillis()
Returns the current time in milliseconds since the Unix Epoch.long
elapsedRealtime()
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.long
uptimeMillis()
-
-
-
Method Detail
-
currentTimeMillis
public long currentTimeMillis()
Description copied from interface:Clock
Returns the current time in milliseconds since the Unix Epoch.- Specified by:
currentTimeMillis
in interfaceClock
- See Also:
System.currentTimeMillis()
-
elapsedRealtime
public long elapsedRealtime()
- Specified by:
elapsedRealtime
in interfaceClock
- See Also:
SystemClock.elapsedRealtime()
-
uptimeMillis
public long uptimeMillis()
- Specified by:
uptimeMillis
in interfaceClock
- See Also:
SystemClock.uptimeMillis()
-
createHandler
public HandlerWrapper createHandler(Looper looper, @Nullable Handler.Callback callback)
Description copied from interface:Clock
Creates aHandlerWrapper
using a specified looper and a specified callback for handling messages.- Specified by:
createHandler
in interfaceClock
- See Also:
Handler(Looper, Handler.Callback)
-
onThreadBlocked
public void onThreadBlocked()
Description copied from interface:Clock
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.
- Specified by:
onThreadBlocked
in interfaceClock
-
-