mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
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.
This commit is contained in:
@ -48,6 +48,7 @@ int main(int argc, char *argv[])
|
||||
<< "clock: iso " << clock::dateTime() << nl;
|
||||
}
|
||||
|
||||
Info<< "since epoch = " << clockValue::now().str() << nl;
|
||||
|
||||
{
|
||||
clockValue a;
|
||||
@ -67,6 +68,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
Info<< "elapsed = " << a.elapsed() << nl;
|
||||
Info<< "elapsed = " << a.elapsed().seconds() << nl;
|
||||
Info<< "elapsed = " << a.elapsed().str() << nl;
|
||||
|
||||
clockValue b = clockValue::now();
|
||||
|
||||
|
||||
@ -323,10 +323,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;
|
||||
|
||||
@ -405,10 +405,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
|
||||
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
|
||||
<< nl << endl;
|
||||
runTime.printExecutionTime(Info);
|
||||
}
|
||||
|
||||
Info<< "pc:" << pc.patchPatchPointConstraintPoints().size() << endl;
|
||||
|
||||
@ -77,17 +77,13 @@ int main(int argc, char *argv[])
|
||||
|
||||
Info<< "Time = " << runTime.timeName() << nl << endl;
|
||||
|
||||
Info<< "Reading : ExecutionTime = " << runTime.elapsedCpuTime() << " s"
|
||||
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
|
||||
<< nl << endl;
|
||||
Info<< "Reading : ";
|
||||
runTime.printExecutionTime(Info);
|
||||
|
||||
mesh.update();
|
||||
|
||||
Info<< "Overset calculation : ExecutionTime = "
|
||||
<< runTime.elapsedCpuTime() << " s"
|
||||
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
|
||||
<< nl << endl;
|
||||
|
||||
Info<< "Overset calculation : ";
|
||||
runTime.printExecutionTime(Info);
|
||||
|
||||
if (false)
|
||||
{
|
||||
@ -110,11 +106,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;
|
||||
|
||||
|
||||
@ -65,9 +65,7 @@ int main(int argc, char *argv[])
|
||||
<< endl;
|
||||
}
|
||||
|
||||
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
|
||||
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
|
||||
<< nl << endl;
|
||||
runTime.printExecutionTime(Info);
|
||||
|
||||
runTime++;
|
||||
Pout<< "Writing particles to time " << runTime.timeName() << endl;
|
||||
@ -89,11 +87,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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user