Use timespec_get on iOS/tvOS/MacCatalyst now that 13.0 is the minimum version#130246
Merged
Conversation
Since iOS/tvOS/MacCatalyst now have 13.0 as the minimum version, timespec_get is available on all these platforms. Only Android still needs the gettimeofday fallback. Closes #122440 Co-authored-by: BrzVlad <4720621+BrzVlad@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update to use timespec_get on iOS/tvOS/Catalyst
Use timespec_get on iOS/tvOS/MacCatalyst now that 13.0 is the minimum version
Jul 6, 2026
BrzVlad
approved these changes
Jul 6, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR simplifies LogAssert time retrieval on Apple mobile targets by removing the gettimeofday fallback and relying on timespec_get for iOS/tvOS/MacCatalyst, while retaining the fallback for Android.
Changes:
- Narrow
gettimeofdayfallback condition inLogAsserttoHOST_ANDROIDonly. - Update the associated comment to reflect the remaining Android-only fallback rationale.
akoeplinger
approved these changes
Jul 6, 2026
This was referenced Jul 6, 2026
Open
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.
timespec_getwas previously unavailable on iOS/tvOS/MacCatalyst below 13.0, soLogAssertindebug.cppfell back togettimeofdayfor those platforms. Since 13.0 is now the minimum deployment target, that fallback is no longer needed there.Changes
src/coreclr/utilcode/debug.cpp: RemoveHOST_IOS,HOST_TVOS, andHOST_MACCATALYSTfrom thegettimeofdayfallback condition —timespec_getis now used directly on those platforms.HOST_ANDROIDretains the fallback since targeted Android API levels still lacktimespec_getsupport.