cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anto...@apache.org
Subject svn commit: r165499 - /cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/servlet/CocoonServlet.java
Date Sun, 01 May 2005 13:07:25 GMT
Author: antonio
Date: Sun May  1 06:07:24 2005
New Revision: 165499

URL: http://svn.apache.org/viewcvs?rev=165499&view=rev
Log:
Use StopWatch

Modified:
    cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/servlet/CocoonServlet.java

Modified: cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/servlet/CocoonServlet.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/servlet/CocoonServlet.java?rev=165499&r1=165498&r2=165499&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/servlet/CocoonServlet.java (original)
+++ cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/servlet/CocoonServlet.java Sun
May  1 06:07:24 2005
@@ -52,6 +52,7 @@
 
 import org.apache.commons.lang.BooleanUtils;
 import org.apache.commons.lang.SystemUtils;
+import org.apache.commons.lang.time.StopWatch;
 import org.apache.excalibur.instrument.InstrumentManager;
 import org.apache.excalibur.instrument.manager.DefaultInstrumentManager;
 import org.apache.log.ContextMap;
@@ -1030,8 +1031,9 @@
             }
         }
 
-        // remember when we started (used for timing the processing)
-        long start = System.currentTimeMillis();
+        // used for timing the processing
+        StopWatch stopWatch = new StopWatch();
+        stopWatch.start();
 
         // add the cocoon header timestamp
         res.addHeader("X-Cocoon-Version", Constants.VERSION);
@@ -1194,10 +1196,10 @@
                 return;
             }
 
-            long end = System.currentTimeMillis();
+            stopWatch.stop();
             String timeString = null;
             if (getLogger().isInfoEnabled()) {
-                timeString = processTime(end - start);
+                timeString = processTime(stopWatch.getTime());
                 getLogger().info("'" + uri + "' " + timeString);
             }
 
@@ -1208,8 +1210,8 @@
                     show = !showTime.equalsIgnoreCase("no");
                 }
                 if (show) {
-                    if ( timeString == null ) {
-                        timeString = processTime(end - start);
+                    if (timeString == null) {
+                        timeString = processTime(stopWatch.getTime());
                     }
                     boolean hide = this.hiddenShowTime;
                     if (showTime != null) {



Mime
View raw message