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
The current clock implementation is limited to millisecond precision, which is the best you can get with Android or Java 8 anyway. But on Java 9 and iOS/macOS, microsecond resolution is available.
Millisecond resolution may be fine for most and should be a bit faster -- certainly, it'll result in fewer allocations when getting the current time. The default should probably be nanosecond precision where available, but providing the option to use a faster millisecond precision clock would be the best of both worlds.
To support nanosecond precision time on Java 9, we'd want to introduce a PlatformInstant expect class that is implemented by Java's Instant class and wrap Java's Clock. This should keep additional allocations to a minimum. Since we'd be using java.time classes under the hood, this implementation won't work on Android though, so it'll require a new target or project rearrangement of some sort.
The text was updated successfully, but these errors were encountered:
The current clock implementation is limited to millisecond precision, which is the best you can get with Android or Java 8 anyway. But on Java 9 and iOS/macOS, microsecond resolution is available.
Millisecond resolution may be fine for most and should be a bit faster -- certainly, it'll result in fewer allocations when getting the current time. The default should probably be nanosecond precision where available, but providing the option to use a faster millisecond precision clock would be the best of both worlds.
To support nanosecond precision time on Java 9, we'd want to introduce a
PlatformInstant
expect class that is implemented by Java'sInstant
class and wrap Java'sClock
. This should keep additional allocations to a minimum. Since we'd be using java.time classes under the hood, this implementation won't work on Android though, so it'll require a new target or project rearrangement of some sort.The text was updated successfully, but these errors were encountered: