reportTotalExecutionTime.H
Go to the documentation of this file.
1// report progress
2const scalar progress = runTime.time().value()/endTime;
3Info<< "Time = " << runTime.timeName() <<" s = "<<runTime.time().value()/sec_year<<" year "
4<<" Progress = "
5<<progress*100.0<<"%"
6<<nl<<endl;
7
8// Report total execution time
9const scalar totalTime_clock = runTime.elapsedCpuTime();
10const scalar totalTime_cpu = runTime.elapsedClockTime();
11const scalar totalTimeEstimate = totalTime_clock/progress;
12if(totalTime_clock<=60)
13{
14 Info<<"ExecutionTime = "<<totalTime_clock<<" s"
15 <<" ClockTime = "<<totalTime_cpu<<" s"
16 << nl << endl;
17}else if(totalTime_clock>60 && totalTime_clock<=3600)
18{
19 Info<<"ExecutionTime = "<<totalTime_clock/60<<" m"
20 <<" ClockTime = "<<totalTime_cpu/60<<" m"
21 << nl << endl;
22}else if(totalTime_clock>3600 && totalTime_clock<=86400)
23{
24 Info<<"ExecutionTime = "<<totalTime_clock/3600<<" h"
25 <<" ClockTime = "<<totalTime_cpu/3600<<" h"
26 << nl << endl;
27}else if(totalTime_clock>86400 && totalTime_clock<=2592000)
28{
29 Info<<"ExecutionTime = "<<totalTime_clock/86400<<" d"
30 <<" ClockTime = "<<totalTime_cpu/86400<<" d"
31 << nl << endl;
32}else
33{
34 Info<<"ExecutionTime = "<<totalTime_clock/2592000<<" months"
35 <<" ClockTime = "<<totalTime_cpu/2592000<<" months"
36 << nl << endl;
37}
const scalar progress