Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This should be enough to close #818, though this is definitely the "interesting" way of doing it.
I'm very on the fence between this and adding an interface into a
SecureRandom
instance. While this feels like the natural-ish function to have inos
, it still has some small details that I feel are inelegant for a standard library function. Meanwhile addingSecureRandom
just feels wrong even though it's the "boring" (and thus desirable) way of doing it.This adds a new function
os.nanoTime
which behaves exactly like the JavaSystem.nanoTime
, except that it overflows on 2^53 instead of 2^64 to maintain full precision as a double. This inherits all the Java edge cases as well as needing a modular reduction for properly compute a duration across timestamp overflows (Java's docs uses thelong
's overflow as a hidden modular reduction).