-
Notifications
You must be signed in to change notification settings - Fork 91
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
Provide constructor for Instant class that takes a Double #77
Comments
The I would instead suggest you define your own constructor by extending the companion object, just so at least you don't have to put a @Suppress("NOTHING_TO_INLINE")
inline fun Instant.Companion.fromEpochMilliseconds(epochMilliseconds: Double) =
Instant.fromEpochMilliseconds(epochMilliseconds.toLong())
val time = Instant.fromEpochMilliseconds(12345678.9) The real question is: have you noticed any significant performance issues in your project while using the library? |
Hello @Jadarma , |
Hello,
I really like using your project. I just miss one little feature:
could you provide a constructor for the Instant class that takes a timestamp of type Double (milliseconds since 1 January 1970 UTC)?
Reason: we try to avoid creating objects in our multi-platform project wherever possible, but using Long for timestamps results in object creation. A Double value can be directly mapped to a JavaScript Number value. It also feels more natural to what the JavaScript Date class does.
Thanks in advance!
The text was updated successfully, but these errors were encountered: