clock Class Reference

Read access to the system clock with formatting. More...

Inheritance diagram for clock:
[legend]

Public Member Functions

 clock ()
 Construct with the current clock time for the start point. More...
 
double elapsedClockTime () const
 Returns wall-clock time since clock instantiation. More...
 
double clockTimeIncrement () const
 Returns wall-clock time since last clockTimeIncrement() call. More...
 

Static Public Member Functions

static time_t getTime ()
 Get the current clock time in seconds. More...
 
static const struct tm rawDate ()
 The current wall-clock date as a raw struct. More...
 
static std::string dateTime ()
 
static std::string date ()
 
static std::string clockTime ()
 

Detailed Description

Read access to the system clock with formatting.

Source files

Definition at line 52 of file clock.H.

Constructor & Destructor Documentation

◆ clock()

clock ( )

Construct with the current clock time for the start point.

Definition at line 113 of file clock.C.

Member Function Documentation

◆ getTime()

time_t getTime ( )
static

Get the current clock time in seconds.

Definition at line 46 of file clock.C.

◆ rawDate()

const struct tm rawDate ( )
static

The current wall-clock date as a raw struct.

Deprecated:
(2020-05) may be removed in future versions

Definition at line 52 of file clock.C.

◆ dateTime()

std::string dateTime ( )
static

The current wall-clock date/time (in local time) as a string in ISO-8601 format (yyyy-mm-ddThh:mm:ss).

Without time-zone information.

Definition at line 60 of file clock.C.

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

Referenced by profilingSysInfo::write(), OBJedgeFormat::write(), STARCDsurfaceFormatCore::writeCase(), and STARCDedgeFormat::writeCase().

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

◆ date()

std::string date ( )
static

The current wall-clock date as a string formatted as (MON dd yyyy), where MON is Jan, Feb, etc.

Definition at line 80 of file clock.C.

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

Referenced by argList::parse().

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

◆ clockTime()

std::string clockTime ( )
static

The current wall-clock (in local time) as a string formatted as as (hh:mm:ss).

Without time-zone information.

Definition at line 95 of file clock.C.

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

Referenced by argList::parse().

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

◆ elapsedClockTime()

double elapsedClockTime ( ) const

Returns wall-clock time since clock instantiation.

Definition at line 122 of file clock.C.

◆ clockTimeIncrement()

double clockTimeIncrement ( ) const

Returns wall-clock time since last clockTimeIncrement() call.

Definition at line 129 of file clock.C.


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