clockTime Class Reference

Starts timing and returns elapsed time from start. Uses std::chrono::high_resolution_clock for better resolution (2uSec instead of ~20mSec) than cpuTime. More...

Public Member Functions

 clockTime ()
 Construct with the current clock value for the start point. More...
 
 clockTime (const clockValue &clockval)
 Implicit construct from the clock value as the start point. More...
 
void resetTime ()
 Reset to use the current clock value for the start point. More...
 
double elapsedTime () const
 The time [seconds] since the start point. More...
 
double timeIncrement () const
 The time [seconds] since the last call to timeIncrement() More...
 

Detailed Description

Starts timing and returns elapsed time from start. Uses std::chrono::high_resolution_clock for better resolution (2uSec instead of ~20mSec) than cpuTime.

Note
It has twice the storage requirement of a simple clockValue since it tracks both total and incremental elapsed times. Additionally, it always invokes a clock query on construction which may make it less desirable for arrays of values (for example).
See also
Foam::clockValue
Source files

Definition at line 62 of file clockTime.H.

Constructor & Destructor Documentation

◆ clockTime() [1/2]

clockTime ( )
inline

Construct with the current clock value for the start point.

Definition at line 30 of file clockTimeI.H.

◆ clockTime() [2/2]

clockTime ( const clockValue clockval)
inline

Implicit construct from the clock value as the start point.

Definition at line 37 of file clockTimeI.H.

Member Function Documentation

◆ resetTime()

void resetTime ( )
inline

Reset to use the current clock value for the start point.

Definition at line 46 of file clockTimeI.H.

◆ elapsedTime()

double elapsedTime ( ) const
inline

The time [seconds] since the start point.

Definition at line 53 of file clockTimeI.H.

◆ timeIncrement()

double timeIncrement ( ) const
inline

The time [seconds] since the last call to timeIncrement()

Definition at line 60 of file clockTimeI.H.

Referenced by TDACChemistryModel< CompType, ThermoType >::solve().

Here is the caller graph for this function:

The documentation for this class was generated from the following files: