[RFC][ReactNative] increase timer resolution

This commit is contained in:
Spencer Ahrens committed 2015-03-17 22:09:03 -08:00
1 parent 9086365faf
commit efd56688ba
2 files changed
+7 -1

No files matched your search

+6
View File
@@ -166,6 +166,12 @@
{
RCT_EXPORT();
if (jsDuration == 0 && repeats == NO) {
// For super fast, one-off timers, just enqueue them immediately rather than waiting a frame.
[_bridge enqueueJSCall:@"RCTJSTimers.callTimers" args:@[@[callbackID]]];
return;
}
NSTimeInterval interval = jsDuration / 1000;
NSTimeInterval jsCreationTimeSinceUnixEpoch = jsSchedulingTime / 1000;
NSTimeInterval currentTimeSinceUnixEpoch = [[NSDate date] timeIntervalSince1970];