Skip to content

[Windows] Thread.sleep(...) time interval precision loss #2576

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 1 commit into from
Dec 10, 2019

Conversation

lxbndr
Copy link
Contributor

@lxbndr lxbndr commented Dec 3, 2019

Thread.sleep(until date:) and Thread.sleep(forTimeInterval:) are initializing LONGLONG (Int64) from TimeInterval (Double), cutting sleep time to whole seconds.

This moves "100ns" time units calculation prior to LONGLONG init.

- Don't lose time interval fraction part on Double->Int64 conversion
- Add tests (which are failing without fix)
@compnerd
Copy link
Member

@swift-ci please test

@compnerd compnerd merged commit dfa3570 into swiftlang:master Dec 10, 2019
@lxbndr lxbndr deleted the windows-thread-sleep branch December 23, 2019 09:10
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.

2 participants