Commit f1666db4 authored by EYRAUD-DUBOIS Lionel's avatar EYRAUD-DUBOIS Lionel

More precise time measurements

parent 0e3b5d67
......@@ -66,8 +66,8 @@ void computeAlg(ProgramOptions& progOpt, Instance* ins,
try {
result->makespan = alg->compute(*ins, &seq);
auto time = chrono::duration_cast<chrono::milliseconds>(chrono::steady_clock::now() - start);
result->milliseconds = time.count();
auto time = chrono::duration_cast<chrono::microseconds>(chrono::steady_clock::now() - start);
result->milliseconds = time.count()/ 1000.0;
//cout << input_file << " " << name << " " << result << " " << time.count();
......@@ -83,9 +83,9 @@ void computeAlg(ProgramOptions& progOpt, Instance* ins,
} catch (int e) {
auto time = chrono::duration_cast<chrono::milliseconds>(chrono::steady_clock::now() - start);
auto time = chrono::duration_cast<chrono::microseconds>(chrono::steady_clock::now() - start);
result->makespan = -1;
result->milliseconds = time.count();
result->milliseconds = time.count() / 1000.0;
}
if(localExport) free(localExport);
......@@ -269,9 +269,9 @@ int main(int argc, char** argv) {
if(progOpt.mergeTolerance > 0) {
instance->autoMerge(progOpt.mergeTolerance);
}
auto time = chrono::duration_cast<chrono::milliseconds>(chrono::steady_clock::now() - start);
auto time = chrono::duration_cast<chrono::microseconds>(chrono::steady_clock::now() - start);
if(progOpt.verbosity >= 4)
cerr << " done (" << time.count() << " ms)." << endl;
cerr << " done (" << time.count()/1000.0 << " ms)." << endl;
instance->display(progOpt.verbosity);
double bestBoundValue = 0;
......@@ -289,15 +289,15 @@ int main(int argc, char** argv) {
bestBoundValue = result;
bestBound = &(*it);
}
auto time = chrono::duration_cast<chrono::milliseconds>(chrono::steady_clock::now() - start);
auto time = chrono::duration_cast<chrono::microseconds>(chrono::steady_clock::now() - start);
// auto duration =
cout << input_file << " " << (instance->platformFile != "" ? instance->platformFile: "NA");
cout << " True " << name << " " << result << " " << time.count();
cout << " True " << name << " " << result << " " << time.count() / 1000.0;
} catch (int e) {
auto time = chrono::duration_cast<chrono::milliseconds>(chrono::steady_clock::now() - start);
auto time = chrono::duration_cast<chrono::microseconds>(chrono::steady_clock::now() - start);
cout << input_file << " " << (instance->platformFile != "" ? instance->platformFile: "NA");
cout << " True " << name << " " << "NA" << " " <<
time.count();
time.count() / 1000.0;
}
if(progOpt.repartitionFile != "") {
......
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