Would this whole + part calculation just (counter * milliDen) /
freq? or you are worry about overflow?
Otherwise, looks good to me.
Thanks for the review!
Yes, overflow here doesn't matter for milliseconds, but will happen
if nanoseconds are used.
Okay, a comment will be good.
Added a comment:
+ // prevent possible overflow
+ long long whole = (counter / freq) * milliDen;
+ long long part = (counter % freq) * milliDen / freq;
+ return whole + part;
Full webrev just for the record:
http://cr.openjdk.java.net/~akasko/jdk8u/8196681/webrev.01/
All other changes to original patch, besides
AccessBridgeDebug#getTimeStamp() above, are either path changes or
string literal changes in debug messages.
Looks good.
Thanks,
-Zhengyu
[...]