diff --git a/src/main/java/mattrixwv/Stopwatch.java b/src/main/java/mattrixwv/Stopwatch.java index 6c4cfa9..c57215c 100644 --- a/src/main/java/mattrixwv/Stopwatch.java +++ b/src/main/java/mattrixwv/Stopwatch.java @@ -50,10 +50,10 @@ public class Stopwatch{ private enum TIME_RESOLUTION{ NANOSECOND, MICROSECOND, MILLISECOND, SECOND, MINUTE, HOUR, ERROR } //Simulates starting a stopwatch by saving the time public void start(){ - //Get the time as close to calling the function as possible - startTime = System.nanoTime(); //Make sure the stop time is reset to 0 stopTime = null; + //Get the time as close to returning from the function as possible + startTime = System.nanoTime(); } //SImulates stoping a stopwatch by saving the time public void stop(){ @@ -98,7 +98,8 @@ public class Stopwatch{ public String getStr(){ //Get the current duration from time Double duration = getTime().doubleValue(); - //Reduce the number to the appropriate number of digits. (xxx.x). This loop works down to seconds + //Reduce the number to the appropriate number of digits. (xxx.x). + //This loop works down to seconds TIME_RESOLUTION resolution; for(resolution = TIME_RESOLUTION.NANOSECOND;(resolution.ordinal() < TIME_RESOLUTION.SECOND.ordinal()) && (duration >= 1000);resolution = TIME_RESOLUTION.values()[resolution.ordinal() + 1]){ duration /= 1000;