Commit c6dded1e authored by Quentin Khan's avatar Quentin Khan

FAlgorithmTimers: catch exception in getTime when timer has not been set

parent 80a169d4
......@@ -56,8 +56,13 @@ public:
/// Elapsed time between last FTic::tic() and FTic::tac() for given timer.
double getTime(std::string TimerName) const{
//assert to verify size
return Timers.at(TimerName).elapsed();
double res = 0;
try {
res = Timers.at(TimerName).elapsed();
} catch(std::out_of_range) {
res = 0;
}
return res;
}
/// Cumulated time between all FTic::tic() and FTic::tac() for given timer.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment