Measures execution time
git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@1466 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
parent
c64bf9fbfe
commit
0a469d1502
1 changed files with 22 additions and 2 deletions
|
|
@ -17,9 +17,9 @@
|
||||||
#include <vectorSortIndex.h>
|
#include <vectorSortIndex.h>
|
||||||
|
|
||||||
#include <utils.h>
|
#include <utils.h>
|
||||||
#include <ctime>
|
|
||||||
#include <apply.h>
|
#include <apply.h>
|
||||||
|
|
||||||
|
|
||||||
gsl_rng *rn2;
|
gsl_rng *rn2;
|
||||||
RandomNr *rn;
|
RandomNr *rn;
|
||||||
//Sequences *seq;
|
//Sequences *seq;
|
||||||
|
|
@ -35,7 +35,9 @@ ProbMatrixContainer *probmatrixs_ptr;
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
|
// measures execution time
|
||||||
|
struct timeval tempo1, tempo2, result;
|
||||||
|
gettimeofday(&tempo1, NULL);
|
||||||
peo :: init( argc, argv );
|
peo :: init( argc, argv );
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -222,6 +224,7 @@ int main(int argc, char *argv[])
|
||||||
delete generationCounter;
|
delete generationCounter;
|
||||||
delete increment;
|
delete increment;
|
||||||
|
|
||||||
|
|
||||||
cout << "\nCalculating Final Solutions...";
|
cout << "\nCalculating Final Solutions...";
|
||||||
cout << " done\n";
|
cout << " done\n";
|
||||||
|
|
||||||
|
|
@ -306,6 +309,23 @@ int main(int argc, char *argv[])
|
||||||
clades_pareto.close();
|
clades_pareto.close();
|
||||||
clades_final.close();
|
clades_final.close();
|
||||||
cout << "\nPhyloMOEA execution finishes !\n";
|
cout << "\nPhyloMOEA execution finishes !\n";
|
||||||
|
gettimeofday(&tempo2, NULL);
|
||||||
|
timeval_subtract(&result,&tempo2,&tempo1);
|
||||||
|
|
||||||
|
long remainder = result.tv_sec % 3600;
|
||||||
|
long hours = (result.tv_sec - remainder)/3600;
|
||||||
|
long seconds = remainder % 60;
|
||||||
|
long minutes = (remainder - seconds) / 60;
|
||||||
|
cout << "Execution time : ";
|
||||||
|
cout.width(3);
|
||||||
|
cout.fill(' ');
|
||||||
|
cout << hours << ":";
|
||||||
|
cout.width(2);
|
||||||
|
cout.fill('0');
|
||||||
|
cout << minutes << ":";
|
||||||
|
cout.width(2);
|
||||||
|
cout.fill('0');
|
||||||
|
cout << seconds << "." << result.tv_usec << endl;
|
||||||
}
|
}
|
||||||
gsl_rng_free(rn2);
|
gsl_rng_free(rn2);
|
||||||
// delete probmatrixs;
|
// delete probmatrixs;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue