<分区>
Possible Duplicate:
Calculating time difference in Milliseconds
我如何检查 java 中某个事件经过了多少毫秒? 例如:
Want to start timer here<<
function doSomething()
.
.
Want to finish timer here<<
我想检查过去了多少毫秒。有办法吗?
<分区>
Possible Duplicate:
Calculating time difference in Milliseconds
我如何检查 java 中某个事件经过了多少毫秒? 例如:
Want to start timer here<<
function doSomething()
.
.
Want to finish timer here<<
我想检查过去了多少毫秒。有办法吗?
最佳答案
System.nanoTime()
并将开始值与结束值进行比较。这是 doc .
Returns the current value of the most precise available system timer, in nanoseconds.
关于java - 如何检查某些事件中经过了多少毫秒(java),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13993076/