--- trunk/gadget/ecosystem.cc 2015/11/09 10:22:57 17 +++ trunk/gadget/ecosystem.cc 2016/05/25 16:36:33 19 @@ -1,6 +1,7 @@ #include "ecosystem.h" #include "runid.h" #include "global.h" +#include #ifdef _OPENMP #include #endif @@ -11,6 +12,8 @@ #endif extern volatile int interrupted_print; +time_t starttime, stoptime; + Ecosystem::Ecosystem(const MainInfo& main) : printinfo(main.getPI()) { funceval = 0; @@ -112,6 +115,7 @@ void Ecosystem::Optimise() { int i; for (i = 0; i < optvec.Size(); i++) { + time(&starttime); #ifdef _OPENMP int j, numThr = omp_get_max_threads ( ); DoubleVector v = this->getValues(); @@ -123,6 +127,7 @@ #else optvec[i]->OptimiseLikelihood(); #endif + time(&stoptime); this->writeOptValues(); } } @@ -183,6 +188,8 @@ handle.logMessage(LOGINFO, "\nThe overall likelihood score is", keeper->getBestLikelihoodScore()); else handle.logMessage(LOGINFO, "\nThe overall likelihood score is", this->getLikelihood()); + + handle.logMessage(LOGINFO, "\n Runtime for the algorithm was ", difftime(stoptime, starttime)," seconds\n"); } void Ecosystem::writeInitialInformation(const char* const filename) {