Loading...
Searching...
No Matches
clock Class Reference

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

#include <clock.H>

Inheritance diagram for clock:

Public Member Functions

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

Static Public Member Functions

static time_t getTime ()
 Get the current clock time in seconds.
static const struct tm rawDate ()
 The current wall-clock date as a raw struct.
static std::string dateTime ()
 The current wall-clock date/time (in local time) as a string in ISO-8601 format (yyyy-mm-ddThh:mm:ss).
static std::string date ()
 The current wall-clock date as a string formatted as (MON dd yyyy), where MON is Jan, Feb, etc.
static std::string clockTime ()
 The current wall-clock (in local time) as a string formatted as as (hh:mm:ss).

Detailed Description

Read access to the system clock with formatting.

Source files

Definition at line 48 of file clock.H.

Constructor & Destructor Documentation

◆ clock()

clock ( )

Construct with the current clock time for the start point.

Definition at line 106 of file clock.C.

References getTime().

Here is the call graph for this function:

Member Function Documentation

◆ getTime()

time_t getTime ( )
static

Get the current clock time in seconds.

Definition at line 39 of file clock.C.

Referenced by clock(), clockTime(), clockTimeIncrement(), date(), dateTime(), elapsedClockTime(), and rawDate().

Here is the caller graph for this function:

◆ 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 45 of file clock.C.

References getTime(), and rawDate().

Referenced by rawDate().

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

◆ 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 53 of file clock.C.

References getTime(), and os().

Referenced by edgeMeshFormat::write(), OBJedgeFormat::write(), OBJsurfaceFormat< Face >::write(), OFFsurfaceFormat< Face >::write(), SMESHsurfaceFormat< Face >::write(), STARCDedgeFormat::writeCase(), STARCDsurfaceFormatCore::writeCase(), profilingSysInfo::writeEntries(), VTKsurfaceFormatCore::writeHeader(), and VTPsurfaceFormatCore::writeHeader().

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 73 of file clock.C.

References getTime(), monthNames, and os().

Referenced by argList::parse(), foamReport::setDynamicBuiltins(), and foamReport::setStaticBuiltins().

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 88 of file clock.C.

References getTime(), and os().

Referenced by argList::parse(), foamReport::setDynamicBuiltins(), and foamReport::setStaticBuiltins().

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 115 of file clock.C.

References getTime().

Referenced by Time::operator++(), and Time::printExecutionTime().

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

◆ clockTimeIncrement()

double clockTimeIncrement ( ) const

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

Definition at line 122 of file clock.C.

References getTime().

Here is the call graph for this function:

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