Skip to content

Conversation

bakkot
Copy link
Contributor

@bakkot bakkot commented Aug 30, 2025

Per suggestion from @lann.

@bakkot bakkot mentioned this pull request Sep 1, 2025
@sunfishcode
Copy link
Member

What are the advantages of having this in a dedicated interface, as opposed to just having everything that needs it just use u64 by convention?

@bakkot
Copy link
Contributor Author

bakkot commented Sep 8, 2025

Just the usual advantages of using a type alias, I assume. Clarity, canonical interpretation, searchability, etc.

I'm not strongly attached to having this type but it already existed as monotonic-clock.duration and was used in other packages, so it seems like it would be good to have it in a more obvious place, which I assume was why @lann suggested this.

@lann
Copy link

lann commented Sep 8, 2025

Yes, I primarily suggested it because it is already being reused. I suppose now that I think about it, this type alias could be used as a hint for bindings generators / shared libraries to use native Duration types.

@sunfishcode
Copy link
Member

Thanks, that sounds reasonable enough to go with here.

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.

3 participants