Skip to content

Clock/Instant/Duration #40609

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 36 commits into from
Feb 17, 2022
Merged

Conversation

phausler
Copy link
Contributor

@phausler phausler commented Dec 17, 2021

This is a draft implementation of the proposal SE-0329 (with the new revisions from the proposal).

Remaining todo:
tolerance/leeway needs to be passed along to the dispatch side of things.

@phausler
Copy link
Contributor Author

@swift-ci please smoke test

@phausler
Copy link
Contributor Author

phausler commented Jan 5, 2022

@swift-ci please build toolchain

@phausler phausler force-pushed the phausler/clock_instant_duration branch from df3443c to 417d5cb Compare January 6, 2022 17:19
@phausler
Copy link
Contributor Author

phausler commented Jan 6, 2022

@swift-ci please build toolchain

3 similar comments
@phausler
Copy link
Contributor Author

phausler commented Jan 6, 2022

@swift-ci please build toolchain

@phausler
Copy link
Contributor Author

phausler commented Jan 7, 2022

@swift-ci please build toolchain

@phausler
Copy link
Contributor Author

@swift-ci please build toolchain

@swift-ci
Copy link
Contributor

Linux Toolchain (Ubuntu 16.04)
Download Toolchain
Git Sha - 6506d7d5aece9320a54ba0c50e35f0aa7d8902f8

Install command
tar zxf swift-PR-40609-773-ubuntu16.04.tar.gz
More info

@phausler phausler requested a review from lorentey January 12, 2022 18:13
@phausler
Copy link
Contributor Author

@lorentey This is the most recent revision of the proposal implemented - I took your feedback and tried to apply to the new versions but it could definitely use a more detailed review.

@phausler
Copy link
Contributor Author

@swift-ci please smoke test

@phausler
Copy link
Contributor Author

@swift-ci please build toolchain

@swift-ci
Copy link
Contributor

Linux Toolchain (Ubuntu 16.04)
Download Toolchain
Git Sha - ca30ddbec3e2cb247be4b97bf26b0a2285387fb7

Install command
tar zxf swift-PR-40609-774-ubuntu16.04.tar.gz
More info

@phausler phausler force-pushed the phausler/clock_instant_duration branch from ca30ddb to 7516147 Compare January 26, 2022 00:16
@phausler
Copy link
Contributor Author

@swift-ci please smoke test

@phausler
Copy link
Contributor Author

@swift-ci please build toolchain

@swift-ci
Copy link
Contributor

Linux Toolchain (Ubuntu 16.04)
Download Toolchain
Git Sha - 7516147

Install command
tar zxf swift-PR-40609-794-ubuntu16.04.tar.gz
More info

Copy link
Member

@lorentey lorentey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is shaping up really well! 👍

I noted some minor nits and a couple of real issues.

"DoubleWide.swift",
"Duration.swift",
"DurationProtocol.swift",
"Instant.swift"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: I think it would make sense to create a new group for these, called "Clock" (or something similar).


@available(SwiftStdlib 9999, *)
public struct SuspendingClock {
public struct Instant: Codable, Sendable {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to provide a CustomStringConvertible conformance for these instant types?

We definitely don't want to print them in a calendrical format, but it might be a good idea to customize the default reflection-based output. (Which looks something like Instant(_value: 23.456 seconds). Would something like T+23.456s be less annoying to read in the long term?)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably; good point

@phausler
Copy link
Contributor Author

@swift-ci please smoke test

2 similar comments
@phausler
Copy link
Contributor Author

@swift-ci please smoke test

@phausler
Copy link
Contributor Author

@swift-ci please smoke test

@phausler
Copy link
Contributor Author

@swift-ci please build toolchain

@swift-ci
Copy link
Contributor

Linux Toolchain (Ubuntu 20.04)
Download Toolchain
Git Sha - 55d0cca8203976d2dbe4c98eecc4ae02bc8ebb3d

Install command
tar zxf swift-PR-40609-799-ubuntu20.04.tar.gz
More info

@phausler
Copy link
Contributor Author

@swift-ci please smoke test

@phausler phausler force-pushed the phausler/clock_instant_duration branch from e66b720 to 07de018 Compare January 27, 2022 23:54
@phausler
Copy link
Contributor Author

@swift-ci please smoke test

@phausler phausler force-pushed the phausler/clock_instant_duration branch from 08afe34 to 5c24901 Compare February 10, 2022 20:16
@phausler phausler requested a review from amartini51 February 11, 2022 00:58
@phausler
Copy link
Contributor Author

@swift-ci please smoke test

@phausler
Copy link
Contributor Author

@swift-ci please smoke test linux

@phausler
Copy link
Contributor Author

@swift-ci please smoke test

1 similar comment
@phausler
Copy link
Contributor Author

@swift-ci please smoke test

@phausler
Copy link
Contributor Author

@swift-ci please smoke test

@phausler phausler merged commit e675b31 into swiftlang:main Feb 17, 2022
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.

5 participants