Skip to content

Commit

Permalink
Don't warn when jsSchedulingOverhead is negative
Browse files Browse the repository at this point in the history
Summary:This commit modifies the jsSchedulingOverhead warning to only fire if the JS clock is more than 5 seconds ahead of the native clock. This fixes the issue in #1598 for the common case when there's only a minor difference between the two clocks, while still keeping a sanity check if they're extremely off.

cc nicklockwood tadeuzagallo
Closes #5731

Differential Revision: D3014985

Pulled By: tadeuzagallo

fb-gh-sync-id: bf57e48b7d97ad02d2aefb6e5aac845824a6fdb0
shipit-source-id: bf57e48b7d97ad02d2aefb6e5aac845824a6fdb0
  • Loading branch information
corbt authored and Facebook Github Bot 3 committed Mar 5, 2016
1 parent 54b6b92 commit 2d27cf0
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions React/Modules/RCTTiming.m
Original file line number Diff line number Diff line change
Expand Up @@ -174,15 +174,7 @@ - (void)didUpdateFrame:(__unused RCTFrameUpdate *)update
return;
}

NSTimeInterval jsSchedulingOverhead = -jsSchedulingTime.timeIntervalSinceNow;
if (jsSchedulingOverhead < 0) {
RCTLogWarn(@"jsSchedulingOverhead (%ims) should be positive", (int)(jsSchedulingOverhead * 1000));

/**
* Probably debugging on device, set to 0 so we don't ignore the interval
*/
jsSchedulingOverhead = 0;
}
NSTimeInterval jsSchedulingOverhead = MAX(-jsSchedulingTime.timeIntervalSinceNow, 0);

NSTimeInterval targetTime = jsDuration - jsSchedulingOverhead;
if (jsDuration < 0.018) { // Make sure short intervals run each frame
Expand Down

0 comments on commit 2d27cf0

Please sign in to comment.