mirror of
https://bitbucket.org/Mattrixwv/javaclasses.git
synced 2025-12-06 23:13:57 -05:00
Fixed a few typos
This commit is contained in:
@@ -36,7 +36,7 @@ public class Stopwatch{
|
|||||||
//Returns a long with the elapsed time in nanoseconds. Used by other functions to get the time before converting it to the correct resolution
|
//Returns a long with the elapsed time in nanoseconds. Used by other functions to get the time before converting it to the correct resolution
|
||||||
private Long getTime(){
|
private Long getTime(){
|
||||||
if(startTime == null){
|
if(startTime == null){
|
||||||
///This should throw an exception instead of returning 0
|
//TODO: This should throw an exception instead of returning 0
|
||||||
return 0L;
|
return 0L;
|
||||||
}
|
}
|
||||||
else if(stopTime == null){
|
else if(stopTime == null){
|
||||||
@@ -55,7 +55,7 @@ public class Stopwatch{
|
|||||||
//Get the time as close to returning from the function as possible
|
//Get the time as close to returning from the function as possible
|
||||||
startTime = System.nanoTime();
|
startTime = System.nanoTime();
|
||||||
}
|
}
|
||||||
//SImulates stoping a stopwatch by saving the time
|
//Simulates stopping a stopwatch by saving the time
|
||||||
public void stop(){
|
public void stop(){
|
||||||
//Set the stopTime as close to call time as possible
|
//Set the stopTime as close to call time as possible
|
||||||
stopTime = System.nanoTime();
|
stopTime = System.nanoTime();
|
||||||
@@ -135,7 +135,7 @@ public class Stopwatch{
|
|||||||
case MINUTE: time += " minutes"; break;
|
case MINUTE: time += " minutes"; break;
|
||||||
case HOUR: time += " hours"; break;
|
case HOUR: time += " hours"; break;
|
||||||
case ERROR:
|
case ERROR:
|
||||||
default: time = "There was an error computing the time"; break; ///This should throw an error instead
|
default: time = "There was an error computing the time"; break; //TODO: This should throw an error instead
|
||||||
}
|
}
|
||||||
//Return the string
|
//Return the string
|
||||||
return time;
|
return time;
|
||||||
|
|||||||
Reference in New Issue
Block a user