robweir     00/03/27 12:27:26

  Modified:    src/org/apache/xalan/xslt XSLTEngineImpl.java
  Log:
  Use long's rather than Date objects for the timing diagnostics.  This avoids 
the
  expensive startup of the calendar code in the JDK.
  
  Revision  Changes    Path
  1.60      +7 -7      xml-xalan/src/org/apache/xalan/xslt/XSLTEngineImpl.java
  
  Index: XSLTEngineImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/src/org/apache/xalan/xslt/XSLTEngineImpl.java,v
  retrieving revision 1.59
  retrieving revision 1.60
  diff -u -r1.59 -r1.60
  --- XSLTEngineImpl.java       2000/03/16 20:58:37     1.59
  +++ XSLTEngineImpl.java       2000/03/27 20:27:25     1.60
  @@ -1685,7 +1685,7 @@
     {
       if(null != key)
       {
  -      m_durationsTable.put(key, new Date());
  +      m_durationsTable.put(key, new Long(System.currentTimeMillis()));
       }
     }
   
  @@ -1698,9 +1698,9 @@
       long millisecondsDuration = 0;
       if(null != key)
       {
  -      Date date1 = (Date)m_durationsTable.get(key);
  -      Date date2 = new Date();
  -      millisecondsDuration = date2.getTime() - date1.getTime();
  +      long start = ((Long)m_durationsTable.get(key)).longValue();
  +      long stop = System.currentTimeMillis();
  +      millisecondsDuration = stop - start;
         m_durationsTable.remove(key);
       }
       return millisecondsDuration;
  @@ -1714,9 +1714,9 @@
       long millisecondsDuration = 0;
       if(null != key)
       {
  -      Date date1 = (Date)m_durationsTable.get(key);
  -      Date date2 = new Date();
  -      millisecondsDuration = date2.getTime() - date1.getTime();
  +      long start = ((Long)m_durationsTable.get(key)).longValue();
  +      long stop = System.currentTimeMillis();
  +      millisecondsDuration = stop - start;
         if(null != m_diagnosticsPrintWriter)
         {
           m_diagnosticsPrintWriter.println(info + " took " + 
millisecondsDuration + " milliseconds");
  
  
  

Reply via email to