Fixed bug where part returned by getStr was off by a factor of 10

This commit is contained in:
2019-03-01 20:03:04 -05:00
parent 3a3ed27845
commit 02aa179389
3 changed files with 3 additions and 2 deletions

Binary file not shown.

View File

@@ -101,8 +101,8 @@ public class Stopwatch{
}
//Turn the number into a string
Double durationFraction = ((duration % 1) * 100);
String time = String.format("% 3d.%03d", duration.intValue(), durationFraction.intValue());
Double durationFraction = ((duration % 1) * 1000);
String time = String.format("%d.%03d", duration.intValue(), durationFraction.intValue());
//Tack on the appropriate suffix for resolution
switch(resolution){

View File

@@ -56,6 +56,7 @@ public class testStopwatch{
//Print the results
System.out.printf("The timer results in: %s\n", timer.getStr());
System.out.printf("The timer results in: %f milliseconds\n", timer.getMilli());
if(!failed){
System.out.println("All tests completed successfully");