activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From franz1981 <...@git.apache.org>
Subject [GitHub] activemq-artemis issue #1517: Simplification on #1515
Date Thu, 07 Sep 2017 10:00:20 GMT
Github user franz1981 commented on the issue:

    https://github.com/apache/activemq-artemis/pull/1517
  
    @clebertsuconic @michaelandrepearce There are a couple of things dependent by using System::nanoTime
that I've addressed in the PR I've made, please have a look on them, because are pretty subtle
:+1: 
    Quoting the [javadoc](https://docs.oracle.com/javase/8/docs/api/java/lang/System.html#nanoTime--):
    
    >  long startTime = System.nanoTime();
    >  // ... the code being measured ...
    >  long estimatedTime = System.nanoTime() - startTime;
    > To compare two nanoTime values
    > 
    >  
    >  long t0 = System.nanoTime();
    >  ...
    >  long t1 = System.nanoTime();
    > one should use t1 - t0 < 0, not t1 < t0, because of the possibility of numerical
overflow.
    > 


---

Mime
View raw message