Skip to content
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

Avoid nanosecond-resolution time where not needed #224

Merged
merged 2 commits into from
Oct 8, 2020

Conversation

rhernandez35
Copy link
Contributor

Instant#now returns an Instant with nanonsecond-level resolution. The
ns-level timer isn't cheap, and is always discarded in X-Ray's code. We
can avoid much of this cost by swapping out Instant#now with
System#currentTimeMillis.

Issue #, if available:

Description of changes:

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

`Instant#now` returns an Instant with nanonsecond-level resolution. The
ns-level timer isn't cheap, and is always discarded in X-Ray's code. We
can avoid much of this cost by swapping out `Instant#now` with
`System#currentTimeMillis`.
Copy link
Contributor

@anuraaga anuraaga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
…ternal/TimeUtils.java
@anuraaga anuraaga merged commit 79a2350 into aws:master Oct 8, 2020
@anuraaga
Copy link
Contributor

anuraaga commented Oct 8, 2020

Thanks @rhernandez35 !

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.

None yet

2 participants