[Accepted] SE-0329: Clock, Instant, and Duration

Hello, Swift community.

The third review of SE-0329: Clock, Instant, and Duration has come to an end. This review was narrowly focused on some APIs involving the Duration type; other aspects of the proposal were accepted during prior reviews.

Review feedback was much lighter, which is not surprising given the narrow scope of the review. The Core Team met and discussed the feedback:

  • There were some questiions in the community about the semantics of the new Duration initializer, given that the range of an Int64 count of attoseconds overlaps the range of a count of seconds. The author confirmed that the intended semantics are simply to add the values and that the documentation will be changed to state this. The Core Team agrees that this is the best resolution.

  • There was some debate about whether init(secondsComponent:attosecondsComponent:) was the best name for the new Duration initializer. The author argues that component in the argument label is not a "useless word" because of the value of associating this initializer with the components property to which it is dual. The Core Team accepts this argument, especially because this API is a stopgap that we expect to be superseded with one that simply uses an Int128 count of attoseconds.

SE-0329 is therefore accepted.

I'd like to thank the community for its patience in guiding this proposal; once again, your contributions have incontrovertibly improved the proposal and helped to make Swift a better programming language.

John McCall
Review Manager


:clap: This is fantastic news! Thanks to everyone for working through the very long pitch and review threads. I think we've ended up in a really really great spot and I'm excited to start using this API!