mirror of
https://bitbucket.org/Mattrixwv/javaclasses.git
synced 2025-12-06 15:03:58 -05:00
Added a function that will return a time string
from a duration passed into it
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user