geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject cvs commit: incubator-geronimo/modules/common/src/java/org/apache/geronimo/common StopWatch.java
Date Sat, 30 Aug 2003 09:29:37 GMT
jdillon     2003/08/30 02:29:37

  Modified:    modules/common/src/java/org/apache/geronimo/common
                        StopWatch.java
  Log:
   o Added toDuration()
  
  Revision  Changes    Path
  1.2       +20 -2     incubator-geronimo/modules/common/src/java/org/apache/geronimo/common/StopWatch.java
  
  Index: StopWatch.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/common/src/java/org/apache/geronimo/common/StopWatch.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- StopWatch.java	24 Aug 2003 21:05:24 -0000	1.1
  +++ StopWatch.java	30 Aug 2003 09:29:37 -0000	1.2
  @@ -218,6 +218,14 @@
       }
       
       /**
  +     * Convert to a duration value.
  +     */
  +    public Duration toDuration()
  +    {
  +        return new Duration(getTime());
  +    }
  +    
  +    /**
        * Return a string representation.
        */
       public String toString()
  @@ -308,6 +316,11 @@
               return watch.isRunning();
           }
           
  +        public Duration toDuration()
  +        {
  +            return watch.toDuration();
  +        }
  +        
           public String toString() {
               return watch.toString();
           }
  @@ -357,7 +370,12 @@
               public synchronized boolean isRunning() {
                   return this.watch.isRunning();
               }
  -
  +            
  +            public synchronized Duration toDuration()
  +            {
  +                return this.watch.toDuration();
  +            }
  +            
               public synchronized String toString() {
                   return this.watch.toString();
               }
  
  
  

Mime
View raw message