diff --git a/headers/Problem.hpp b/headers/Problem.hpp index 026dbbc..9a1dfb2 100644 --- a/headers/Problem.hpp +++ b/headers/Problem.hpp @@ -55,18 +55,12 @@ public: } //Get the time it took to run the algorithm as a string virtual std::string getTime(){ - //If the problem hasn't been solved throw an exception - if(!solved){ - throw Unsolved(); - } + solvedCheck("time it took to run the algorithm"); return timer.getStr(); } //Get a copy of the timer that was used to time the algorithm virtual mee::Stopwatch getTimer(){ - //If the problem hasn't been solved throw an exception - if(!solved){ - throw Unsolved(); - } + solvedCheck("timer"); return timer; } //Reset the problem so it can be run again