RFR: 8273239: Standardize Ticks APIs return type

Albert Mingkun Yang ayang at openjdk.java.net
Thu Sep 2 09:27:39 UTC 2021


On Thu, 2 Sep 2021 02:41:07 GMT, David Holmes <dholmes at openjdk.org> wrote:

> When people ask for the time in ms/us/ns they expect integral values

Situations for both expecting fractional and integral values exist. Standardizing the APIs means the caller can switch between different units, get the same amount of info, and decide how to treat the sub-unit part.

> If there is code that wants a time in say ms + us + ns then they can call seconds() and do the conversion themselves IMO.

Yes; there are many `seconds() * 1000.0` in `g1CollectedHeap.cpp` for instance, which could be simplified with the new APIs.

-------------

PR: https://git.openjdk.java.net/jdk/pull/5332


More information about the hotspot-dev mailing list