The Gaudi Framework  master (ff829712)
Loading...
Searching...
No Matches
Chrono Class Reference

A small utility class for chronometry of user codes. More...

#include </builds/gaudi/Gaudi/GaudiKernel/include/GaudiKernel/Chrono.h>

Collaboration diagram for Chrono:

Public Member Functions

 Chrono (IChronoSvc *svc=nullptr, const std::string &tag="CHRONO::UNNAMED")
 Constructor from Chrono Service and the tag.
 
 Chrono (Chrono &&rhs)
 
 Chrono (const std::string &tag, IChronoSvc *svc)
 Constructor from Chrono Service and the tag.
 
 Chrono (ChronoEntity *c)
 Constructor from Chrono Object/Entity.
 
 Chrono (ChronoEntity &c)
 Constructor from Chrono Object/Entity.
 
 ~Chrono ()
 Destructor , stop the chrono.
 

Private Member Functions

 Chrono (const Chrono &)=delete
 
Chronooperator= (const Chrono &)=delete
 

Private Attributes

ChronoEntitym_chrono = nullptr
 The actual chronometer.
 

Detailed Description

A small utility class for chronometry of user codes.

See also
ChronoEntity
IChronoSvc
Author
Vanya Belyaev
Date
Nov 26, 1999

Definition at line 27 of file Chrono.h.

Constructor & Destructor Documentation

◆ Chrono() [1/6]

Chrono::Chrono ( IChronoSvc * svc = nullptr,
const std::string & tag = "CHRONO::UNNAMED" )
inline

Constructor from Chrono Service and the tag.

IChronoSvc* svc = ... ;
{ // start the scope
Chrono chrono ( svc , "some unique tag here" ) ;
for ( long i = 0 ; i < 10000000 ; ++i )
{
.. put some CPU-intensive computations here
}
} // end of the scope, destroy chrono
Chrono(IChronoSvc *svc=nullptr, const std::string &tag="CHRONO::UNNAMED")
Constructor from Chrono Service and the tag.
Definition Chrono.h:50
"Chrono"-related part of interface IChronoStatSvc
Definition IChronoSvc.h:31
Parameters
svcpointer to Chrono Service
tagthe unique tag

Definition at line 50 of file Chrono.h.

52 {
53 if ( svc ) { m_chrono = svc->chronoStart( tag ); }
54 }
ChronoEntity * m_chrono
The actual chronometer.
Definition Chrono.h:144
virtual ChronoEntity * chronoStart(const ChronoTag &t)=0
start chrono, tagged by its name

◆ Chrono() [2/6]

Chrono::Chrono ( Chrono && rhs)
inline

Definition at line 56 of file Chrono.h.

56 {
57 m_chrono = rhs.m_chrono;
58 rhs.m_chrono = nullptr;
59 }

◆ Chrono() [3/6]

Chrono::Chrono ( const std::string & tag,
IChronoSvc * svc )
inline

Constructor from Chrono Service and the tag.

IChronoSvc* svc = ... ;
{ // start the scope
Chrono chrono ( "some unique tag here" , svc ) ;
for ( long i = 0 ; i < 10000000 ; ++i )
{
.. put some CPU-intensive computations here
}
} // end of the scope, destroy chrono
Parameters
tagthe unique tag
svcpointer to Chrono Service

Definition at line 82 of file Chrono.h.

84 {
85 if ( svc ) { m_chrono = svc->chronoStart( tag ); }
86 }

◆ Chrono() [4/6]

Chrono::Chrono ( ChronoEntity * c)
inline

Constructor from Chrono Object/Entity.

ChronoEntity* chronometer = ... ;
{ // start the scope
Chrono chrono ( chronometer ) ;
for ( long i = 0 ; i < 10000000 ; ++i )
{
.. put some CPU-intensive computations here
}
} // end of the scope, destroy chrono
a small helper class for implementation of ChronoStatSvc service, It also could be used as some local...
Parameters
cthe pointer to Chrono Object/Entity

Definition at line 108 of file Chrono.h.

108 : m_chrono( c ) {
109 if ( m_chrono ) { m_chrono->start(); }
110 }

◆ Chrono() [5/6]

Chrono::Chrono ( ChronoEntity & c)
inline

Constructor from Chrono Object/Entity.

{ // start the scope
Chrono chrono ( m_chrono ) ;
for ( long i = 0 ; i < 10000000 ; ++i )
{
.. put some CPU-intensive computations here
}
} // end of the scope, destroy chrono
Parameters
cthe reference to Chrono Object/Entity

Definition at line 132 of file Chrono.h.

132: m_chrono( &c ) { m_chrono->start(); }

◆ ~Chrono()

Chrono::~Chrono ( )
inline

Destructor , stop the chrono.

Definition at line 135 of file Chrono.h.

135 {
136 if ( m_chrono ) { m_chrono->stop(); }
137 }

◆ Chrono() [6/6]

Chrono::Chrono ( const Chrono & )
privatedelete

Member Function Documentation

◆ operator=()

Chrono & Chrono::operator= ( const Chrono & )
privatedelete

Member Data Documentation

◆ m_chrono

ChronoEntity* Chrono::m_chrono = nullptr
private

The actual chronometer.

Definition at line 144 of file Chrono.h.


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