Added a function that will return a time string

from a duration passed into it
This commit is contained in:
2020-07-09 01:44:04 -04:00
parent f4cfb03f58
commit d3a71af6dd

View File

@@ -97,7 +97,11 @@ public class Stopwatch{
//Returns the time as a string at the 'best' resolution. (Goal is xxx.xxx)
public String getStr(){
//Get the current duration from time
Double duration = getTime().doubleValue();
return getStr(getTime().doubleValue());
}
public static String getStr(double nanoseconds){
Double duration = nanoseconds;
//Reduce the number to the appropriate number of digits. (xxx.x).
//This loop works down to seconds
TIME_RESOLUTION resolution;