mirror of
https://bitbucket.org/Mattrixwv/javaclasses.git
synced 2025-12-06 15:03:58 -05:00
Fixed bug that caused incorrect resolution label
This commit is contained in:
@@ -105,16 +105,17 @@ public class Stopwatch{
|
||||
duration /= 1000;
|
||||
}
|
||||
//Check if the duration needs reduced to minutes
|
||||
if(duration >= 120){
|
||||
if((duration >= 120) && (resolution == TIME_RESOLUTION.SECOND)){
|
||||
//Reduce to minutes
|
||||
duration /= 60;
|
||||
resolution = TIME_RESOLUTION.values()[resolution.ordinal() + 1];
|
||||
}
|
||||
//Check if the duration needs reduced to hours
|
||||
if(duration >= 60){
|
||||
//Reduce to hours
|
||||
duration /= 60;
|
||||
resolution = TIME_RESOLUTION.values()[resolution.ordinal() + 1];
|
||||
|
||||
//Check if the duration needs reduced to hours
|
||||
if(duration >= 60){
|
||||
//Reduce to hours
|
||||
duration /= 60;
|
||||
resolution = TIME_RESOLUTION.values()[resolution.ordinal() + 1];
|
||||
}
|
||||
}
|
||||
|
||||
//Turn the number into a string
|
||||
|
||||
Reference in New Issue
Block a user