@Implements(value=android.os.SystemClock.class) public class ShadowSystemClock extends java.lang.Object
Robolectric’s concept of current time is base on the current time of the UI Scheduler for consistency with previous implementations. This is not ideal, since both schedulers (background and foreground), can see different values for the current time.
Constructor and Description |
---|
ShadowSystemClock() |
Modifier and Type | Method and Description |
---|---|
static long |
currentThreadTimeMicro() |
static long |
currentThreadTimeMillis() |
static long |
currentTimeMicro() |
static long |
currentTimeMillis()
Implements
System.currentTimeMillis() through ShadowWrangler. |
static long |
elapsedRealtime() |
static long |
nanoTime()
Implements
System.nanoTime() through ShadowWrangler. |
static boolean |
setCurrentTimeMillis(long millis) |
static void |
setNanoTime(long nanoTime) |
static void |
sleep(long millis) |
static long |
uptimeMillis() |
@Implementation public static void sleep(long millis)
@Implementation public static boolean setCurrentTimeMillis(long millis)
@Implementation public static long uptimeMillis()
@Implementation public static long elapsedRealtime()
@Implementation public static long currentThreadTimeMillis()
@HiddenApi @Implementation public static long currentThreadTimeMicro()
@HiddenApi @Implementation public static long currentTimeMicro()
public static long currentTimeMillis()
Implements System.currentTimeMillis()
through ShadowWrangler.
public static long nanoTime()
Implements System.nanoTime()
through ShadowWrangler.
public static void setNanoTime(long nanoTime)