commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bay...@apache.org
Subject cvs commit: jakarta-commons-sandbox/util/src/java/org/apache/commons/util StopWatch.java
Date Tue, 10 Dec 2002 14:49:14 GMT
bayard      2002/12/10 06:49:14

  Modified:    util/src/java/org/apache/commons/util StopWatch.java
  Log:
  Changed StopWatch so its getTimeString is static and may be used separately
  from the StopWatch's context.
  [This reverses a change scolebourne made to make it protected somewhat, so
   he might want to snap my head off ;)]
  
  Revision  Changes    Path
  1.3       +3 -4      jakarta-commons-sandbox/util/src/java/org/apache/commons/util/StopWatch.java
  
  Index: StopWatch.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/util/src/java/org/apache/commons/util/StopWatch.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- StopWatch.java	23 Nov 2002 01:07:10 -0000	1.2
  +++ StopWatch.java	10 Dec 2002 14:49:13 -0000	1.3
  @@ -143,7 +143,7 @@
        * @return the time as a String
        */
       public String toString() {
  -        return getTimeString();
  +        return StopWatch.getTimeString(getTime());
       }
   
       /**
  @@ -152,11 +152,10 @@
        * 
        * @return the time as a String
        */
  -    protected String getTimeString() {
  +    public static String getTimeString(long time) {
           int HIM = 60 * 60 * 1000;
           int MIM = 60 * 1000;
           int hours, minutes, seconds, milliseconds;
  -        long time = getTime();
           hours = (int) (time / HIM);
           time = time - (hours * HIM);
           minutes = (int) (time / MIM);
  
  
  

--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message