Commit dd8341f6 authored by Mark Olesen's avatar Mark Olesen
Browse files

ENH: make format of ExecutionTime = ... output configurable (issue #788)

- controlled by the the 'printExecutionFormat' InfoSwitch in
  etc/controlDict

      // Style for "ExecutionTime = " output
      // - 0 = seconds (with trailing 's')
      // - 1 = day-hh:mm:ss

   ExecutionTime = 112135.2 s  ClockTime = 113017 s

   ExecutionTime = 1-07:08:55.20  ClockTime = 1-07:23:37

- Callable via the new Time::printExecutionTime() method,
  which also helps to reduce clutter in the applications.
  Eg,

     runTime.printExecutionTime(Info);

  vs

     Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
         << "  ClockTime = " << runTime.elapsedClockTime() << " s"
         << nl << endl;

--

ENH: return elapsedClockTime() and clockTimeIncrement as double

- previously returned as time_t, which is less portable.
parent 0743b61a
......@@ -126,9 +126,7 @@ int main(int argc, char *argv[])
);
}
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl;
runTime.printExecutionTime(Info);
}
Info<< "End\n" << endl;
......
......@@ -93,9 +93,7 @@ int main(int argc, char *argv[])
#include "write.H"
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl;
runTime.printExecutionTime(Info);
}
Info<< "End\n" << endl;
......
......@@ -96,9 +96,7 @@ int main(int argc, char *argv[])
#include "write.H"
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl;
runTime.printExecutionTime(Info);
}
Info<< "End\n" << endl;
......
......@@ -247,9 +247,7 @@ int main(int argc, char *argv[])
runTime.functionObjects().end();
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl;
runTime.printExecutionTime(Info);
Info<< "End\n" << endl;
......
......@@ -235,9 +235,7 @@ int main(int argc, char *argv[])
runTime.functionObjects().end();
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl;
runTime.printExecutionTime(Info);
Info<< "End\n" << endl;
......
......@@ -150,9 +150,7 @@ int main(int argc, char *argv[])
runTime.write();
Info<< "\nExecutionTime = "
<< runTime.elapsedCpuTime()
<< " s\n" << endl;
runTime.printExecutionTime(Info);
}
Info<< "\n end\n";
......
......@@ -198,9 +198,7 @@ int main(int argc, char *argv[])
runTime.write();
Info<< "\nExecutionTime = "
<< runTime.elapsedCpuTime()
<< " s\n" << endl;
runTime.printExecutionTime(Info);
}
Info<< "\n end\n";
......
......@@ -170,9 +170,7 @@ int main(int argc, char *argv[])
runTime.write();
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl;
runTime.printExecutionTime(Info);
}
Info<< "End\n" << endl;
......
......@@ -128,9 +128,7 @@ int main(int argc, char *argv[])
runTime.write();
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl;
runTime.printExecutionTime(Info);
}
Info<< "End\n" << endl;
......
......@@ -82,9 +82,7 @@ int main(int argc, char *argv[])
#include "output.H"
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl;
runTime.printExecutionTime(Info);
}
Info << "Number of steps = " << runTime.timeIndex() << endl;
......
......@@ -106,9 +106,7 @@ int main(int argc, char *argv[])
#include "logSummary.H"
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl;
runTime.printExecutionTime(Info);
}
Info<< "End\n" << endl;
......
......@@ -140,9 +140,7 @@ int main(int argc, char *argv[])
runTime.write();
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl;
runTime.printExecutionTime(Info);
}
Info<< "End\n" << endl;
......
......@@ -118,9 +118,7 @@ int main(int argc, char *argv[])
runTime.write();
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl;
runTime.printExecutionTime(Info);
}
Info<< "End" << endl;
......
......@@ -119,9 +119,7 @@ int main(int argc, char *argv[])
runTime.write();
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl;
runTime.printExecutionTime(Info);
}
Info<< "End\n" << endl;
......
......@@ -113,9 +113,7 @@ int main(int argc, char *argv[])
runTime.write();
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl;
runTime.printExecutionTime(Info);
}
Info<< "End\n" << endl;
......
......@@ -121,9 +121,7 @@ int main(int argc, char *argv[])
runTime.write();
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl;
runTime.printExecutionTime(Info);
}
Info<< "End\n" << endl;
......
......@@ -266,9 +266,7 @@ int main(int argc, char *argv[])
runTime.write();
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl;
runTime.printExecutionTime(Info);
}
Info<< "End\n" << endl;
......
......@@ -254,9 +254,7 @@ int main(int argc, char *argv[])
runTime.write();
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl;
runTime.printExecutionTime(Info);
}
Info<< "End\n" << endl;
......
......@@ -115,9 +115,7 @@ int main(int argc, char *argv[])
runTime.write();
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl;
runTime.printExecutionTime(Info);
}
Info<< "End\n" << endl;
......
......@@ -157,9 +157,7 @@ int main(int argc, char *argv[])
runTime.write();
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl;
runTime.printExecutionTime(Info);
}
Info<< "End\n" << endl;
......
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