-
Notifications
You must be signed in to change notification settings - Fork 10.5k
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
Clock/Instant/Duration #40609
Conversation
@swift-ci please smoke test |
@swift-ci please build toolchain |
df3443c
to
417d5cb
Compare
@swift-ci please build toolchain |
3 similar comments
@swift-ci please build toolchain |
@swift-ci please build toolchain |
@swift-ci please build toolchain |
Linux Toolchain (Ubuntu 16.04) Install command |
@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. |
@swift-ci please smoke test |
@swift-ci please build toolchain |
Linux Toolchain (Ubuntu 16.04) Install command |
ca30ddb
to
7516147
Compare
@swift-ci please smoke test |
@swift-ci please build toolchain |
Linux Toolchain (Ubuntu 16.04) Install command |
There was a problem hiding this 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" |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably; good point
@swift-ci please smoke test |
@swift-ci please build toolchain |
Linux Toolchain (Ubuntu 20.04) Install command |
@swift-ci please smoke test |
e66b720
to
07de018
Compare
@swift-ci please smoke test |
…(SwiftStdlib 9999, *)
…few more missing availabilities
…ding/decoding to string based serialization
…ing/decoding but as unkeyed
08afe34
to
5c24901
Compare
…n, DurationProtocol and InstantProtocol
@swift-ci please smoke test |
@swift-ci please smoke test linux |
@swift-ci please smoke test |
1 similar comment
@swift-ci please smoke test |
@swift-ci please smoke test |
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.