Use mach_absolute_time for HighResTimeStamp on Apple platforms#55977
Closed
rubennorte wants to merge 1 commit intofacebook:mainfrom
Closed
Use mach_absolute_time for HighResTimeStamp on Apple platforms#55977rubennorte wants to merge 1 commit intofacebook:mainfrom
rubennorte wants to merge 1 commit intofacebook:mainfrom
Conversation
Summary: Changelog: [internal] On iOS/macOS, `std::chrono::steady_clock` uses `mach_continuous_time()` which includes device sleep time. This causes compatibility issues with iOS system APIs like `UITouch.timestamp` and `NSProcessInfo.processInfo.systemUptime` which use `mach_absolute_time()` (excludes sleep time). This diff modifies `HighResTimeStamp` to use `mach_absolute_time()` directly on Apple platforms, ensuring timestamps are compatible with iOS system APIs and native performance logging systems. Changes: - Added `mach_absolute_time()` based clock for Apple platforms in `primitives.h` - Simplified `RCTHighResTimeStampFromSeconds()` since iOS timestamps now share the same clock domain - Updated documentation to explain platform-specific clock behavior Differential Revision: D95554947
|
@rubennorte has exported this pull request. If you are a Meta employee, you can view the originating Diff in D95554947. |
|
This pull request has been merged in 6aa99ad. |
Collaborator
|
This pull request was successfully merged by @rubennorte in 6aa99ad When will my fix make it into a release? | How to file a pick request? |
rubennorte
added a commit
to rubennorte/react-native
that referenced
this pull request
Mar 10, 2026
Summary: Changelog: [iOS][Added] Add privacy manifest to declare the use of mach_absolute_time() API in the React-timing module Add privacy manifest to declare the use of mach_absolute_time() API in the React-timing module, as required by Apple's privacy manifest requirements. This addresses problems with facebook#55977 about potential App Store rejections when using mach_absolute_time() without declaring it in the privacy manifest. Changes: - Created PrivacyInfo.xcprivacy declaring NSPrivacyAccessedAPICategorySystemBootTime with reason code 35F9.1 (measuring elapsed time between events) - Updated React-timing.podspec to include the privacy manifest via resource_bundles - Updated reactPerformanceTimeline target to include the timing privacy manifest Reviewed By: cipolleschi Differential Revision: D96018599
meta-codesync bot
pushed a commit
that referenced
this pull request
Mar 10, 2026
…6046) Summary: Pull Request resolved: #56046 Changelog: [iOS][Added] Add privacy manifest to declare the use of mach_absolute_time() API in the React-timing module Add privacy manifest to declare the use of mach_absolute_time() API in the React-timing module, as required by Apple's privacy manifest requirements. This addresses problems with #55977 about potential App Store rejections when using mach_absolute_time() without declaring it in the privacy manifest. Changes: - Created PrivacyInfo.xcprivacy declaring NSPrivacyAccessedAPICategorySystemBootTime with reason code 35F9.1 (measuring elapsed time between events) - Updated React-timing.podspec to include the privacy manifest via resource_bundles - Updated reactPerformanceTimeline target to include the timing privacy manifest Reviewed By: cipolleschi Differential Revision: D96018599 fbshipit-source-id: 36025538015ac7c039e97adf2a0204cb8040330c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
Changelog: [internal]
On iOS/macOS,
std::chrono::steady_clockusesmach_continuous_time()which includes device sleep time. This causes compatibility issues with iOS system APIs likeUITouch.timestampandNSProcessInfo.processInfo.systemUptimewhich usemach_absolute_time()(excludes sleep time).This diff modifies
HighResTimeStampto usemach_absolute_time()directly on Apple platforms, ensuring timestamps are compatible with iOS system APIs and native performance logging systems.Changes:
mach_absolute_time()based clock for Apple platforms inprimitives.hRCTHighResTimeStampFromSeconds()since iOS timestamps now share the same clock domainDifferential Revision: D95554947