|
|
|
|
|
|
|
|
if(x < MinimumSleeperTime || |
|
|
if(x < MinimumSleeperTime || |
|
|
x > MaximumSleeperTime) // If it's not a good time value |
|
|
x > MaximumSleeperTime) // If it's not a good time value |
|
|
throw BadSleeperValue(); // then throw the exception. |
|
|
throw BadSleeperValue(); // then throw the exception. |
|
|
MillisecondsToSleep = x; // If it is good - set it. |
|
|
|
|
|
|
|
|
MillisecondsToSleep = x; // If it is good - set it.
|
|
|
|
|
|
return MillisecondsToSleep; // Return the set value. |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
int Sleeper::getMillisecondsToSleep() { // Safe way to get the value. |
|
|
int Sleeper::getMillisecondsToSleep() { // Safe way to get the value. |