You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 8, 2022. It is now read-only.
A lot of Kotlin devs are probably used to this API especially for conversion between different units of time. Would you be interested in a (probably very small) PR to add a multiplatform version?
The text was updated successfully, but these errors were encountered:
One benefit of TimeUnit is that it can convert between values without any class instantiation, but that may not be enough of a gain to justify adding it to the API. Maybe all that's needed is a little translation layer within the JVM module for conversions to work with Java/Kotlin APIs which expect a Long and a TimeUnit, like withTimeout. I'll chew it over for a bit and try to get you a PR. And thanks for the great library! :)
Yeah, right now it instantates objects. The same goes for operator overloads: 1.seconds + 1000.milliseconds instantiates 3 objects. But it is safer to do artithmetic this way, and nicer for arguments and for storing times.
Allocation will be zero once inline classes ships: Kotlin/KEEP#103
And/Or project valhalla. Since most of these classes are immutable with a single field.
Still, if you think it makes sense, create a PR :)
Klock 1.0.0 will be released later this week and will use Kotlin 1.3 inline, so I guess that this is not required anymore. I'm closing it. Feel free to reopen if required.
A lot of Kotlin devs are probably used to this API especially for conversion between different units of time. Would you be interested in a (probably very small) PR to add a multiplatform version?
The text was updated successfully, but these errors were encountered: