本文整理汇总了Java中com.facebook.react.common.SystemClock.uptimeMillis方法的典型用法代码示例。如果您正苦于以下问题:Java SystemClock.uptimeMillis方法的具体用法?Java SystemClock.uptimeMillis怎么用?Java SystemClock.uptimeMillis使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.facebook.react.common.SystemClock
的用法示例。
在下文中一共展示了SystemClock.uptimeMillis方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: run
import com.facebook.react.common.SystemClock; //导入方法依赖的package包/类
@Override
public void run() {
if (mCancelled) {
return;
}
long frameTimeMillis = mFrameStartTime / 1000000;
long timeSinceBoot = SystemClock.uptimeMillis();
long frameTimeElapsed = timeSinceBoot - frameTimeMillis;
long time = SystemClock.currentTimeMillis();
long absoluteFrameStartTime = time - frameTimeElapsed;
if (FRAME_DURATION_MS - (float) frameTimeElapsed < IDLE_CALLBACK_FRAME_DEADLINE_MS) {
return;
}
mIdleCallbackContextsToCall.clear();
synchronized (mIdleCallbackGuard) {
mIdleCallbackContextsToCall.addAll(mSendIdleEventsExecutorTokens);
}
for (ExecutorToken context : mIdleCallbackContextsToCall) {
getReactApplicationContext().getJSModule(context, JSTimersExecution.class)
.callIdleCallbacks(absoluteFrameStartTime);
}
mCurrentIdleCallbackRunnable = null;
}
示例2: init
import com.facebook.react.common.SystemClock; //导入方法依赖的package包/类
/**
* This method needs to be called before event is sent to event dispatcher.
*/
protected void init(int viewTag) {
mViewTag = viewTag;
mTimestampMs = SystemClock.uptimeMillis();
mInitialized = true;
}