# DataExchange
TKXSBase
MoniTool

# MoniTool_Timer Class Reference

Provides convenient service on global timers
accessed by string name, mostly aimed for debugging purposes
As an instance, envelopes the OSD_Timer to have it as Handle
.

`#include <MoniTool_Timer.hxx>`

## Public Member Functions

| MoniTool_Timer ()
| Create timer in empty state .
const OSD_Timer & | Timer () const
OSD_Timer & | Timer ()
| Return reference to embedded OSD_Timer .
void | Start ()
void | Stop ()
void | Reset ()
| Start, Stop and reset the timer In addition to doing that to embedded OSD_Timer, manage also counter of hits .
Standard_Integer | Count () const
| Return value of hits counter (count of Start/Stop pairs) .
Standard_Integer | IsRunning () const
| Returns value of nesting counter .
Standard_Real | CPU ()
| Return value of CPU time minus accumulated amendment .
Standard_Real | Amend () const
| Return value of accumulated amendment on CPU time .
Standard_EXPORT void | Dump (Standard_OStream &ostr)
| Dumps current state of a timer shortly (one-line output) .
Standard_EXPORT const | Handle (Standard_Type)&DynamicType() const

## Static Public Member Functions

static Standard_EXPORT Handle_MoniTool_Timer | Timer (const Standard_CString name)
| Returns a timer from a dictionary by its name If timer not existed, creates a new one .
static void | Start (const Standard_CString name)
static void | Stop (const Standard_CString name)
| Inline methods to conveniently start/stop timer by name Shortcut to Timer(name)->Start/Stop() .
static Standard_EXPORT MoniTool_DataMapOfTimer & | Dictionary ()
| Returns map of timers .
static Standard_EXPORT void | ClearTimers ()
| Clears map of timers .
static Standard_EXPORT void | DumpTimers (Standard_OStream &ostr)
| Dumps contents of the whole dictionary .
static Standard_EXPORT void | ComputeAmendments ()
| Computes and remembers amendments for times to access, start, and stop of timer, and estimates second-order error measured by 10 nested timers .
static Standard_EXPORT void | GetAmendments (Standard_Real &Access, Standard_Real &Internal, Standard_Real &External, Standard_Real &Error10)
| The computed amendmens are returned (for information only) .

## Private Member Functions

Standard_EXPORT void | AmendStart ()
Standard_EXPORT void | AmendStop ()
| Internal functions to amend other timers to avoid side effects of operations with current one .

## Static Private Member Functions

static Standard_EXPORT void | AmendAccess ()

## Private Attributes

OSD_Timer | myTimer
Standard_Integer | myCount
Standard_Integer | myNesting
Standard_Real | myAmend
Handle_MoniTool_Timer | myPrev
Handle_MoniTool_Timer | myNext

## Constructor & Destructor Documentation

MoniTool_Timer::MoniTool_Timer | ( |  | ) | `[inline]`

## Member Function Documentation

Standard_Real MoniTool_Timer::Amend | ( |  | ) | const`[inline]`

static Standard_EXPORT void MoniTool_Timer::AmendAccess | ( |  | ) | `[static, private]`

Standard_EXPORT void MoniTool_Timer::AmendStart | ( |  | ) | `[private]`

Standard_EXPORT void MoniTool_Timer::AmendStop | ( |  | ) | `[private]`

static Standard_EXPORT void MoniTool_Timer::ClearTimers | ( |  | ) | `[static]`

static Standard_EXPORT void MoniTool_Timer::ComputeAmendments | ( |  | ) | `[static]`

Standard_Integer MoniTool_Timer::Count | ( |  | ) | const`[inline]`

Standard_Real MoniTool_Timer::CPU | ( |  | ) | `[inline]`

static Standard_EXPORT MoniTool_DataMapOfTimer& MoniTool_Timer::Dictionary | ( |  | ) | `[static]`

Standard_EXPORT void MoniTool_Timer::Dump | ( | Standard_OStream & | ostr | ) |

static Standard_EXPORT void MoniTool_Timer::DumpTimers | ( | Standard_OStream & | ostr | ) | `[static]`

static Standard_EXPORT void MoniTool_Timer::GetAmendments | ( | Standard_Real & | Access,
|  | Standard_Real & | Internal,
|  | Standard_Real & | External,
|  | Standard_Real & | Error10
| ) | `[static]`

Standard_EXPORT const MoniTool_Timer::Handle | ( | Standard_Type |  | ) | const

Standard_Integer MoniTool_Timer::IsRunning | ( |  | ) | const`[inline]`

void MoniTool_Timer::Reset | ( |  | ) | `[inline]`

void MoniTool_Timer::Start | ( | const Standard_CString | name | ) | `[inline, static]`

void MoniTool_Timer::Start | ( |  | ) | `[inline]`

void MoniTool_Timer::Stop | ( | const Standard_CString | name | ) | `[inline, static]`

void MoniTool_Timer::Stop | ( |  | ) | `[inline]`

static Standard_EXPORT Handle_MoniTool_Timer MoniTool_Timer::Timer | ( | const Standard_CString | name | ) | `[static]`

OSD_Timer & MoniTool_Timer::Timer | ( |  | ) | `[inline]`

const OSD_Timer & MoniTool_Timer::Timer | ( |  | ) | const`[inline]`

## Field Documentation

Standard_Real MoniTool_Timer::myAmend `[private]`

Standard_Integer MoniTool_Timer::myCount `[private]`

Standard_Integer MoniTool_Timer::myNesting `[private]`

Handle_MoniTool_Timer MoniTool_Timer::myNext `[private]`

Handle_MoniTool_Timer MoniTool_Timer::myPrev `[private]`

OSD_Timer MoniTool_Timer::myTimer `[private]`

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

- MoniTool_Timer.hxx
- MoniTool_Timer.lxx