|
[Sponsors] |
November 16, 2014, 16:55 |
write CPU time with higher precision
|
#1 |
New Member
Anonymous
Join Date: Mar 2012
Posts: 6
Rep Power: 14 |
Is there a way to get a CPU time difference with more precision?
The standard for runTime.elapsedCpuTime() seems to be two digits. When printing more digits using setprecision(18), I just get extra 0's or 9's, not really a higher precision? |
|
June 3, 2017, 21:07 |
|
#2 |
Member
Karelke Yu
Join Date: Dec 2014
Posts: 96
Rep Power: 11 |
Hi, did you find a way to do this?
|
|
September 1, 2023, 03:12 |
excutive time with high resolution
|
#3 |
New Member
Join Date: Jul 2019
Location: MARS
Posts: 9
Rep Power: 7 |
The "clockTime" Class would help, as its description:
"Starts timing and returns elapsed time from start. Uses std::chrono::high_resolution_clock for better resolution (2uSec instead of ~20mSec) than cpuTime. " So the code would be like: Code:
#include "clockTime.H" Foam::clockTime myTime; Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" //<< " ClockTime = " << runTime.elapsedClockTime() << " s" << " ClockTime = " << myTime.elapsedTime() << " s" << endl; |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to export time series of variables for one point? | mary mor | OpenFOAM Post-Processing | 8 | July 19, 2017 11:54 |
simpleFoam error - "Floating point exception" | mbcx4jc2 | OpenFOAM Running, Solving & CFD | 12 | August 4, 2015 03:20 |
time step directories naming issue | Andrea_85 | OpenFOAM | 3 | April 3, 2014 09:38 |
dynamic Mesh is faster than MRF???? | sharonyue | OpenFOAM Running, Solving & CFD | 14 | August 26, 2013 08:47 |
CPU time Vs Wall clock time | HMR | CFX | 2 | February 28, 2012 20:06 |