systemml-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <>
Subject [GitHub] [systemml] xtern edited a comment on issue #862: Systemml 2526 Date.getTime() can be changed to System.currentTimeMillis()
Date Mon, 15 Apr 2019 17:24:23 GMT
xtern edited a comment on issue #862: Systemml 2526 Date.getTime() can be changed to System.currentTimeMillis()
   > Hello, please see the example program.
   Hello! I was a little confused with your benchmarking and re-checked these results with
JMH on Ubuntu (jdk8) and found that the difference is not that significant: currentTimeMillis
faster for 0.02 nanosecond per operation (less than the measurement error).
   Anyway I think It's much better to use currentTimeMillis instead of new Date().getTime()
   Benchmark             Mode  Cnt   Score   Error  Units
   TimeTest.checkDate    avgt   10  22.733 ± 0.106  ns/op
   TimeTest.checkMillis  avgt   10  22.753 ± 0.106  ns/op
   import java.util.Date;
   import java.util.concurrent.TimeUnit;
   import org.openjdk.jmh.annotations.Benchmark;
   import org.openjdk.jmh.annotations.BenchmarkMode;
   import org.openjdk.jmh.annotations.Fork;
   import org.openjdk.jmh.annotations.Measurement;
   import org.openjdk.jmh.annotations.Mode;
   import org.openjdk.jmh.annotations.OutputTimeUnit;
   import org.openjdk.jmh.annotations.Scope;
   import org.openjdk.jmh.annotations.State;
   import org.openjdk.jmh.annotations.Threads;
   import org.openjdk.jmh.annotations.Warmup;
   import org.openjdk.jmh.runner.Runner;
   import org.openjdk.jmh.runner.RunnerException;
   import org.openjdk.jmh.runner.options.Options;
   import org.openjdk.jmh.runner.options.OptionsBuilder;
   @Fork(value = 1, jvmArgsAppend = {"-Xms3g", "-Xmx3g", "-server", "-XX:+AggressiveOpts"})
   @Warmup(iterations = 10)
   @Measurement(iterations = 20)
   public class TimeTest {
       public long checkDate() {
           return new Date().getTime();
       public long checkMillis() {
           return System.currentTimeMillis();
       public static void main(String[] args) throws RunnerException {
           final Options options = new OptionsBuilder()
           new Runner(options).run();

This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:

With regards,
Apache Git Services

View raw message