Skip to content

Commit 2d27cf0

Browse files
corbtFacebook Github Bot 3
authored andcommitted
Don't warn when jsSchedulingOverhead is negative
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 facebook#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 facebook#5731 Differential Revision: D3014985 Pulled By: tadeuzagallo fb-gh-sync-id: bf57e48b7d97ad02d2aefb6e5aac845824a6fdb0 shipit-source-id: bf57e48b7d97ad02d2aefb6e5aac845824a6fdb0
1 parent 54b6b92 commit 2d27cf0

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

React/Modules/RCTTiming.m

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -174,15 +174,7 @@ - (void)didUpdateFrame:(__unused RCTFrameUpdate *)update
174174
return;
175175
}
176176

177-
NSTimeInterval jsSchedulingOverhead = -jsSchedulingTime.timeIntervalSinceNow;
178-
if (jsSchedulingOverhead < 0) {
179-
RCTLogWarn(@"jsSchedulingOverhead (%ims) should be positive", (int)(jsSchedulingOverhead * 1000));
180-
181-
/**
182-
* Probably debugging on device, set to 0 so we don't ignore the interval
183-
*/
184-
jsSchedulingOverhead = 0;
185-
}
177+
NSTimeInterval jsSchedulingOverhead = MAX(-jsSchedulingTime.timeIntervalSinceNow, 0);
186178

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

0 commit comments

Comments
 (0)