clockValue Class Reference

Access to high-resolution clock value with some basic operations. More...

Public Member Functions

 clockValue ()
 Construct zero initialized. More...
 
 clockValue (const value_type &value)
 Construct from duration with the same clock base. More...
 
 clockValue (bool useNow)
 Construct zero initialized or with current time. More...
 
const value_type & value () const
 Return the value. More...
 
void clear ()
 Reset to zero. More...
 
void update ()
 Update to the current now() time from the system. More...
 
clockValue elapsed () const
 The time elapsed from now() since the start time. More...
 
long seconds () const
 The value in seconds (rounded) More...
 
std::string str () const
 Format as day-hh:mm:ss string. More...
 
 operator double () const
 Conversion operator to seconds in floating point. More...
 
clockValueoperator-= (const clockValue &rhs)
 Subtract time value. More...
 
clockValueoperator+= (const clockValue &rhs)
 Add time value. More...
 

Static Public Member Functions

static clockValue now ()
 Return the current time value from the system. More...
 

Detailed Description

Access to high-resolution clock value with some basic operations.

Source files

Definition at line 51 of file clockValue.H.

Constructor & Destructor Documentation

◆ clockValue() [1/3]

Construct zero initialized.

Definition at line 36 of file clockValue.C.

Referenced by clockValue::now().

Here is the caller graph for this function:

◆ clockValue() [2/3]

clockValue ( const value_type &  value)
explicit

Construct from duration with the same clock base.

Definition at line 42 of file clockValue.C.

◆ clockValue() [3/3]

clockValue ( bool  useNow)
explicit

Construct zero initialized or with current time.

Definition at line 48 of file clockValue.C.

References clockValue::update().

Here is the call graph for this function:

Member Function Documentation

◆ now()

static clockValue now ( )
inlinestatic

Return the current time value from the system.

Definition at line 78 of file clockValue.H.

References clockValue::clockValue().

Referenced by profiling::beginTimer(), and profiling::writeData().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ value()

const value_type& value ( ) const
inline

Return the value.

Definition at line 87 of file clockValue.H.

Referenced by Foam::operator+(), and Foam::operator-().

Here is the caller graph for this function:

◆ clear()

void clear ( )

Reset to zero.

Definition at line 61 of file clockValue.C.

◆ update()

void update ( )

Update to the current now() time from the system.

Definition at line 67 of file clockValue.C.

Referenced by clockValue::clockValue().

Here is the caller graph for this function:

◆ elapsed()

Foam::clockValue elapsed ( ) const

The time elapsed from now() since the start time.

Definition at line 73 of file clockValue.C.

Referenced by profiling::endTimer(), and regionSplit::reduceRegions().

Here is the caller graph for this function:

◆ seconds()

long seconds ( ) const

The value in seconds (rounded)

Definition at line 79 of file clockValue.C.

◆ str()

std::string str ( ) const

Format as day-hh:mm:ss string.

Definition at line 85 of file clockValue.C.

References Foam::setfill(), and Foam::setw().

Here is the call graph for this function:

◆ operator double()

operator double ( ) const

Conversion operator to seconds in floating point.

Definition at line 133 of file clockValue.C.

◆ operator-=()

Foam::clockValue & operator-= ( const clockValue rhs)

Subtract time value.

Definition at line 143 of file clockValue.C.

◆ operator+=()

Foam::clockValue & operator+= ( const clockValue rhs)

Add time value.

Definition at line 150 of file clockValue.C.


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