RFR: 8311639: Replace currentTimeMillis() with nanoTime() in jtreg/gc

Albert Mingkun Yang ayang at openjdk.org
Fri Aug 18 11:19:25 UTC 2023


On Fri, 18 Aug 2023 09:19:08 GMT, Leo Korinth <lkorinth at openjdk.org> wrote:

>> I could possibly add some characters to the key if that is what bothers you. I could of course also use `currentTimeMillis` as it is nothing wrong with it. But I would prefer removing `currentTimeMillis` in all gc testing.
>
> I will try to see if I can do it without using time at all.

Not using time is probably the best. Not obvious if #digits here is critical. Maybe this is useful -- e.g. to generate fixed 6-digit int:


Random rnd = new Random();
int n = 100_000 + rnd.nextInt(900_000);

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

PR Review Comment: https://git.openjdk.org/jdk/pull/15331#discussion_r1298333710


More information about the hotspot-gc-dev mailing list