You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by ba...@apache.org on 2002/12/10 15:49:14 UTC
cvs commit: jakarta-commons-sandbox/util/src/java/org/apache/commons/util StopWatch.java
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: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>