On 27 October 2014 22:05, <[email protected]> wrote: > Author: pmouawad > Date: Mon Oct 27 22:05:54 2014 > New Revision: 1634699 > > URL: http://svn.apache.org/r1634699 > Log: > Oups wrong conversion
-1 > > Modified: > jmeter/trunk/src/core/org/apache/jmeter/control/RunTime.java > > Modified: jmeter/trunk/src/core/org/apache/jmeter/control/RunTime.java > URL: > http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/control/RunTime.java?rev=1634699&r1=1634698&r2=1634699&view=diff > ============================================================================== > --- jmeter/trunk/src/core/org/apache/jmeter/control/RunTime.java (original) > +++ jmeter/trunk/src/core/org/apache/jmeter/control/RunTime.java Mon Oct 27 > 22:05:54 2014 > @@ -72,7 +72,7 @@ public class RunTime extends GenericCont > } > > private boolean endOfLoop() { > - return ((System.nanoTime() - startTime)/1000) >= 1000 * getRuntime(); > + return ((System.nanoTime() - startTime)/1000000.0) >= 1000 * > getRuntime(); That looks wrong on several counts. getRuntime() is in seconds. The original code was return System.currentTimeMillis() - startTime >= 1000 * getRuntime(); i.e. it compared the elapsed time using milliseconds. Also it's not efficient to perform arithmetic on both sides of the comparison I think the code should be return ((System.nanoTime() - startTime)/1000000L) >= getRuntime(); Or one could use return (System.nanoTime() - startTime) >= 1000000L * getRuntime(); but that is more likely to overflow. > } > > @Override > >
