Skip to content

Conversation

@zpencer
Copy link
Contributor

@zpencer zpencer commented Sep 26, 2018

We should reflect changes in the system clock.

We should reflect changes in the system clock.
public long currentTimeNanos() {
return System.nanoTime() + offsetNanos;
return TimeUnit.MILLISECONDS.toNanos(System.currentTimeMillis());
}
Copy link
Contributor

Choose a reason for hiding this comment

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

After your change, it will return the same nano value for any invocation that happens within one millisecond.

Copy link
Contributor

@dapengzhang0 dapengzhang0 left a comment

Choose a reason for hiding this comment

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

LGTM
We can merge this first and fix #5056 later.

@zpencer zpencer merged commit 777bbbb into grpc:master Nov 20, 2018
@zpencer zpencer deleted the fix-timeprovider-clock-change branch November 20, 2018 19:35
@lock lock bot locked as resolved and limited conversation to collaborators Feb 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants