Repository navigation
[DO NOT MERGE] Reproducer for #60450: performance.timeOrigin + now() lags Date.now() by sleep on iOS - #60451
[DO NOT MERGE] Reproducer for #60450: performance.timeOrigin + now() lags Date.now() by sleep on iOS#60451will-selfactualize wants to merge 1 commit into
Conversation
…ep on iOS Shows Date.now() - (performance.timeOrigin + performance.now()) in the Playground, refreshed every second. On iOS/macOS it jumps by the sleep duration after the device or host Mac sleeps; it should stay ~0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
Reproducer only, not for merging. This is the reproducer requested for #60450.
Summary:
On iOS and macOS,
performance.timeOrigin + performance.now()lagsDate.now()by the device's total sleep time since boot. Since #55977 (first released in 0.86.0),now()usesmach_absolute_time(), which stops during sleep.timeOriginis still computed againststd::chrono::steady_clock(mach_continuous_time()), which keeps counting during sleep. Root cause and suggested fix are in #60450.This PR changes only
RNTesterPlayground.js, so that it displaysDate.now() - (performance.timeOrigin + performance.now())once a second.Changelog:
[INTERNAL] - Playground reproducer for #60450
Test Plan:
The same drift on a 0.86.3 Mac Catalyst app was 2178.79 s. On that machine,
mach_continuous_time() - mach_absolute_time()was 2178.8 s at the same moment.🤖 Generated with Claude Code