time measure with System.currentTimeMillis()

Aleksey Shipilev aleksey.shipilev at oracle.com
Thu May 7 11:17:17 UTC 2015


Hi,

On 05/07/2015 01:34 PM, Yves Bugge wrote:
> Hello, I want to know, why you use the method
> System.currentTimeMillis() in BaseRunne.class at runBenchmark()  for
> time  measure?  I have expected that you use a measurement method,
> which returned Nano seconds, because you can convert this time in
> Nanoseconds (output unit). Currently, I use the version 1.9. I hope
> you can help me.

Help with what exactly? Do you see that is a problem?

Those values end up in BenchmarkResultMetadata, and they are wall-clock
timestamps. We need these to correlate the timing in the forked VM with
timings in host VM and/or external profilers. In other words, nanoTime
is good for doing *relative* time measurements, but we need the absolute
timestamps.

Thanks,
-Aleksy.



More information about the jmh-dev mailing list