jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1651522 - /jmeter/trunk/src/core/org/apache/jmeter/util/CPSPauser.java
Date Tue, 13 Jan 2015 22:18:13 GMT
Author: pmouawad
Date: Tue Jan 13 22:18:13 2015
New Revision: 1651522

URL: http://svn.apache.org/r1651522
Log:
No need to call native method if no sleep required

Modified:
    jmeter/trunk/src/core/org/apache/jmeter/util/CPSPauser.java

Modified: jmeter/trunk/src/core/org/apache/jmeter/util/CPSPauser.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/util/CPSPauser.java?rev=1651522&r1=1651521&r2=1651522&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/util/CPSPauser.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/util/CPSPauser.java Tue Jan 13 22:18:13 2015
@@ -51,7 +51,9 @@ public class CPSPauser{
         long sleepMS = (bytes*MS_PER_SEC)/CPS;
         int  sleepNS = ((bytes*MS_PER_SEC)/CPS) % NS_PER_MS;
         try {
-            Thread.sleep(sleepMS,sleepNS);
+            if(sleepMS>0 || sleepNS>0) {
+                Thread.sleep(sleepMS,sleepNS);
+            }
         } catch (InterruptedException ignored) {
         }
     }



Mime
View raw message