Added myexeption to throw errors and show using MyExeption class.
This commit is contained in:
@@ -8,6 +8,8 @@
|
||||
|
||||
#include "simulation.hpp"
|
||||
|
||||
#include "myexeption.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
|
||||
@@ -18,9 +20,12 @@ int main(int argc, const char * argv[]) {
|
||||
double duration;
|
||||
start = clock();
|
||||
|
||||
|
||||
Simulation Sim;
|
||||
Sim.doit();
|
||||
try {
|
||||
Simulation Sim;
|
||||
Sim.doit();
|
||||
} catch (MyException& caught) {
|
||||
cout<<caught.what()<<endl;
|
||||
}
|
||||
|
||||
duration = ( clock() - start ) / (double) CLOCKS_PER_SEC;
|
||||
cout<<"Duration: "<< duration <<'\n';
|
||||
|
||||
Reference in New Issue
Block a user