Skip to content

[stdlib] Some more clock adjustments #41512

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Feb 23, 2022
Merged

Conversation

lorentey
Copy link
Member

This is a followup to #41485.

  • Fix a logic bug in _Int128 division (oops)
  • Add a direct method for multiplying an _Int128 by a UInt64 value; use it for scaling values in Duration.
  • Add methods to divide _[U]Int128 values by select constant values using the multiply+shift method. Use this to generate Duration.components, improving performance (by 1.5x to 2.7x depending on CPU)
  • Fix SuspendingClock.minimumResolution to return the resolution, not the time
  • Adjust the ordering of arguments in Duration's internal direct initializer to match the corresponding _Int128 init

@lorentey lorentey requested a review from phausler February 22, 2022 19:08
@lorentey
Copy link
Member Author

@swift-ci test

@lorentey
Copy link
Member Author

@swift-ci test linux

@lorentey lorentey merged commit d384a79 into swiftlang:main Feb 23, 2022
@lorentey lorentey deleted the clock-fixes branch February 23, 2022 02:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant