52 std::chrono::high_resolution_clock::time_point realtimeData;
53 std::clock_t cputimeData;
80 const auto& t1 = startTime_.realtimeData;
81 const auto& t2 = stopTime.realtimeData;
82 std::chrono::duration<double> dt =
83 std::chrono::duration_cast<std::chrono::duration<double> >(t2 - t1);
85 realTimeElapsed_ += dt.count();
87 static_cast<double>(stopTime.cputimeData
88 - startTime_.cputimeData)/CLOCKS_PER_SEC;
93 return realTimeElapsed_;
102 cpuTimeElapsed_ = 0.0;
103 realTimeElapsed_ = 0.0;
111 cpuTimeElapsed_ = 0.0;
112 realTimeElapsed_ = 0.0;
114 measure_(startTime_);
124 return realTimeElapsed_;
130 const auto& t1 = startTime_.realtimeData;
131 const auto& t2 = stopTime.realtimeData;
132 std::chrono::duration<double> dt =
133 std::chrono::duration_cast<std::chrono::duration<double> >(t2 - t1);
135 return realTimeElapsed_ + dt.count();
153 return cpuTimeElapsed_;
159 const auto& t1 = startTime_.cputimeData;
160 const auto& t2 = stopTime.cputimeData;
162 return cpuTimeElapsed_ +
static_cast<double>(t2 - t1)/CLOCKS_PER_SEC;
173 double globalVal = val;
202 static void measure_(TimeData& timeData)
206 timeData.realtimeData = std::chrono::high_resolution_clock::now();
207 timeData.cputimeData = std::clock();
211 double cpuTimeElapsed_;
212 double realTimeElapsed_;
Provides an encapsulation to measure the system time.
Definition: timer.hh:49
void reset()
Make the current point in time t=0 but do not change the status of the timer.
Definition: timer.hh:109
void start()
Start counting the time resources used by the simulation.
Definition: timer.hh:62
double elapsed() const
This is an alias for realTimeElapsed()
Definition: timer.hh:143
void halt()
Stop the measurement reset all timing values.
Definition: timer.hh:99
double realTimeElapsed() const
Return the real time [s] elapsed during the periods the timer was active since the last reset.
Definition: timer.hh:121
Timer()
Definition: timer.hh:56
double globalCpuTimeElapsed() const
Return the CPU time [s] used by all threads of the all processes of program.
Definition: timer.hh:170
Timer & operator+=(const Timer &other)
Adds the time of another timer to the current one.
Definition: timer.hh:191
double stop()
Stop counting the time resources.
Definition: timer.hh:73
double cpuTimeElapsed() const
Return the CPU time [s] used by all threads of the local process for the periods the timer was active...
Definition: timer.hh:150
Definition: blackoilboundaryratevector.hh:37