![]() |
Open CASCADE Technology Reference Manual 8.0.0
|
Provides convenient service on global timers accessed by string name, mostly aimed for debugging purposes. More...
#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. | |
| int | Count () const |
| Return value of hits counter (count of Start/Stop pairs) | |
| int | IsRunning () const |
| Returns value of nesting counter. | |
| double | CPU () |
| Return value of CPU time minus accumulated amendment. | |
| double | Amend () const |
| Return value of accumulated amendment on CPU time. | |
| void | Dump (Standard_OStream &ostr) |
| Dumps current state of a timer shortly (one-line output) | |
Public Member Functions inherited from Standard_Transient | |
| Standard_Transient () | |
| Empty constructor. | |
| Standard_Transient (const Standard_Transient &) | |
| Copy constructor – does nothing. | |
| Standard_Transient & | operator= (const Standard_Transient &) |
| Assignment operator, needed to avoid copying reference counter. | |
| virtual | ~Standard_Transient ()=default |
| Destructor must be virtual. | |
| virtual const opencascade::handle< Standard_Type > & | DynamicType () const |
| Returns a type descriptor about this object. | |
| bool | IsInstance (const opencascade::handle< Standard_Type > &theType) const |
| Returns a true value if this is an instance of Type. | |
| bool | IsInstance (const char *const theTypeName) const |
| Returns a true value if this is an instance of TypeName. | |
| bool | IsKind (const opencascade::handle< Standard_Type > &theType) const |
| Returns true if this is an instance of Type or an instance of any class that inherits from Type. Note that multiple inheritance is not supported by OCCT RTTI mechanism. | |
| bool | IsKind (const char *const theTypeName) const |
| Returns true if this is an instance of TypeName or an instance of any class that inherits from TypeName. Note that multiple inheritance is not supported by OCCT RTTI mechanism. | |
| Standard_Transient * | This () const |
| Returns non-const pointer to this object (like const_cast). For protection against creating handle to objects allocated in stack or call from constructor, it will raise exception Standard_ProgramError if reference counter is zero. | |
| int | GetRefCount () const noexcept |
| Get the reference counter of this object. | |
| void | IncrementRefCounter () noexcept |
| Increments the reference counter of this object. Uses relaxed memory ordering since incrementing only requires atomicity, not synchronization with other memory operations. | |
| int | DecrementRefCounter () noexcept |
| Decrements the reference counter of this object; returns the decremented value. Uses release ordering for the decrement to ensure all writes to the object are visible before the count reaches zero. An acquire fence is added only when the count reaches zero, ensuring proper synchronization before deletion. This is more efficient than using acq_rel for every decrement. | |
| virtual void | Delete () const |
| Memory deallocator for transient classes. | |
Static Public Member Functions | |
| static occ::handle< MoniTool_Timer > | Timer (const char *const name) |
| Returns a timer from a dictionary by its name If timer not existed, creates a new one. | |
| static void | Start (const char *const name) |
| static void | Stop (const char *const name) |
| Inline methods to conveniently start/stop timer by name Shortcut to Timer(name)->Start/Stop() | |
| static NCollection_DataMap< const char *, occ::handle< MoniTool_Timer >, Standard_CStringHasher > & | Dictionary () |
| Returns map of timers. | |
| static void | ClearTimers () |
| Clears map of timers. | |
| static void | DumpTimers (Standard_OStream &ostr) |
| Dumps contents of the whole dictionary. | |
| static 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 void | GetAmendments (double &Access, double &Internal, double &External, double &Error10) |
| The computed amendmens are returned (for information only) | |
Static Public Member Functions inherited from Standard_Transient | |
| static constexpr const char * | get_type_name () |
| Returns a type descriptor about this object. | |
| static const opencascade::handle< Standard_Type > & | get_type_descriptor () |
| Returns type descriptor of Standard_Transient class. | |
Additional Inherited Members | |
Public Types inherited from Standard_Transient | |
| typedef void | base_type |
| Returns a type descriptor about this object. | |
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
As a tool, supports static dictionary of timers and provides static methods to easily access them
| MoniTool_Timer::MoniTool_Timer | ( | ) |
Create timer in empty state.
| double MoniTool_Timer::Amend | ( | ) | const |
Return value of accumulated amendment on CPU time.
Computes and remembers amendments for times to access, start, and stop of timer, and estimates second-order error measured by 10 nested timers.
| int MoniTool_Timer::Count | ( | ) | const |
Return value of hits counter (count of Start/Stop pairs)
| double MoniTool_Timer::CPU | ( | ) |
Return value of CPU time minus accumulated amendment.
|
static |
Returns map of timers.
| void MoniTool_Timer::Dump | ( | Standard_OStream & | ostr | ) |
Dumps current state of a timer shortly (one-line output)
|
static |
Dumps contents of the whole dictionary.
|
static |
The computed amendmens are returned (for information only)
| int MoniTool_Timer::IsRunning | ( | ) | const |
Returns value of nesting counter.
| void MoniTool_Timer::Reset | ( | ) |
Start, Stop and reset the timer In addition to doing that to embedded OSD_Timer, manage also counter of hits.
| void MoniTool_Timer::Start | ( | ) |
| void MoniTool_Timer::Stop | ( | ) |
Inline methods to conveniently start/stop timer by name Shortcut to Timer(name)->Start/Stop()
| const OSD_Timer & MoniTool_Timer::Timer | ( | ) | const |
|
static |
Returns a timer from a dictionary by its name If timer not existed, creates a new one.