commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pste...@apache.org
Subject svn commit: r1102553 - /commons/sandbox/performance/trunk/src/java/org/apache/commons/performance/ClientThread.java
Date Fri, 13 May 2011 03:20:22 GMT
Author: psteitz
Date: Fri May 13 03:20:22 2011
New Revision: 1102553

URL: http://svn.apache.org/viewvc?rev=1102553&view=rev
Log:
Changed to use nanoTime for latency measurement.

Modified:
    commons/sandbox/performance/trunk/src/java/org/apache/commons/performance/ClientThread.java

Modified: commons/sandbox/performance/trunk/src/java/org/apache/commons/performance/ClientThread.java
URL: http://svn.apache.org/viewvc/commons/sandbox/performance/trunk/src/java/org/apache/commons/performance/ClientThread.java?rev=1102553&r1=1102552&r2=1102553&view=diff
==============================================================================
--- commons/sandbox/performance/trunk/src/java/org/apache/commons/performance/ClientThread.java
(original)
+++ commons/sandbox/performance/trunk/src/java/org/apache/commons/performance/ClientThread.java
Fri May 13 03:20:22 2011
@@ -168,17 +168,17 @@ public abstract class ClientThread imple
                 }
                 
                 // Fire the request and measure response time
-                start = System.currentTimeMillis();
+                lastStart = System.currentTimeMillis();
+                start = System.nanoTime();
                 execute();
             } catch (Exception ex) {
                 ex.printStackTrace();
                 success = false;
             } finally {
                 try {
-                    responseStats.addValue(System.currentTimeMillis() - start);
+                    responseStats.addValue((System.nanoTime() - start)/1000);
                     successStats.addValue(success ? 1 : 0);
                     onTimeStats.addValue(onTime ? 1 : 0);
-                    lastStart = start;
                     cleanUp();
                 } catch (Exception e) {
                     e.printStackTrace();                    



Mime
View raw message