Skip to content

[close #404] use System.nanoTime() to calculate duration, cause System.currentTimeMillis() is not monotonic (#402)#417

Merged
marsishandsome merged 2 commits intotikv:release-3.1from
ti-srebot:release-3.1-1405fe7c800b
Dec 17, 2021
Merged

[close #404] use System.nanoTime() to calculate duration, cause System.currentTimeMillis() is not monotonic (#402)#417
marsishandsome merged 2 commits intotikv:release-3.1from
ti-srebot:release-3.1-1405fe7c800b

Conversation

@ti-srebot
Copy link
Copy Markdown
Collaborator

@ti-srebot ti-srebot commented Dec 17, 2021

cherry-pick #402 to release-3.1
You can switch your code base to this Pull Request by using git-extras:

# In client-java repo:
git pr https://github.com/tikv/client-java/pull/417

After apply modifications, you can push your change to this PR via:

git push git@github.com:ti-srebot/client-java.git pr/417:release-3.1-1405fe7c800b

Signed-off-by: marsishandsome marsishandsome@gmail.com

close #404

use System.nanoTime() to calculate duration, cause System.currentTimeMillis() is not monotonic

The performance between System.nanoTime() and System.currentTimeMillis() is almost the same.
see https://www.javaadvent.com/2019/12/measuring-time-from-java-to-kernel-and-back.html

Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
@ti-srebot
Copy link
Copy Markdown
Collaborator Author

/run-all-tests

Copy link
Copy Markdown
Collaborator

@marsishandsome marsishandsome left a comment

Choose a reason for hiding this comment

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

LGTM

@marsishandsome
Copy link
Copy Markdown
Collaborator

/run-all-tests

2 similar comments
@marsishandsome
Copy link
Copy Markdown
Collaborator

/run-all-tests

@marsishandsome
Copy link
Copy Markdown
Collaborator

/run-all-tests

Copy link
Copy Markdown
Member

@iosmanthus iosmanthus left a comment

Choose a reason for hiding this comment

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

LGTM

@marsishandsome
Copy link
Copy Markdown
Collaborator

/run-all-tests

1 similar comment
@marsishandsome
Copy link
Copy Markdown
Collaborator

/run-all-tests

@marsishandsome marsishandsome merged commit 8b1c265 into tikv:release-3.1 Dec 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants