RFR: 8365919: Replace currentTimeMillis with nanoTime in Stresser.java [v3]

Thomas Schatzl tschatzl at openjdk.org
Tue Aug 26 07:17:36 UTC 2025


On Mon, 25 Aug 2025 14:09:13 GMT, Albert Mingkun Yang <ayang at openjdk.org> wrote:

>> Mostly a mechanic change from `currentTimeMillis()` to `nanoTime()/1000000`. It also removes `finishTime` to avoid overflowing.
>> 
>> The change in `iteration()` is to ensure `currentTime` is properly initialized.
>> 
>> (Was investigating a timeout on Windows-x64, which led me to this code. I think this fix is good enough by its own.)
>>  
>> Test: tier1-5
>
> Albert Mingkun Yang has updated the pull request incrementally with one additional commit since the last revision:
> 
>   review

Changes requested by tschatzl (Reviewer).

test/hotspot/jtreg/vmTestbase/nsk/share/test/Stresser.java line 185:

> 183:     public void printExecutionInfo(PrintStream out) {
> 184:         println(out, "Completed iterations: " + iterations);
> 185:         println(out, "Execution time: " + (currentTime - startTime)/1_000_000_000.0 + " seconds");

Suggestion:

        println(out, "Execution time: " + (currentTime - startTime) / 1_000_000_000.0 + " seconds");

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

PR Review: https://git.openjdk.org/jdk/pull/26879#pullrequestreview-3154208625
PR Review Comment: https://git.openjdk.org/jdk/pull/26879#discussion_r2299984613


More information about the hotspot-gc-dev mailing list