The Gaudi Framework  master (37c0b60a)
Chrono Class Reference

#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. More...
 
 Chrono (Chrono &&rhs)
 Move Constructor. More...
 
 Chrono (const std::string &tag, IChronoSvc *svc)
 Constructor from Chrono Service and the tag. More...
 
 Chrono (ChronoEntity *c)
 Constructor from Chrono Object/Entity. More...
 
 Chrono (ChronoEntity &c)
 Constructor from Chrono Object/Entity. More...
 
 ~Chrono ()
 Destructor , stop the chrono. More...
 

Private Member Functions

 Chrono (const Chrono &)=delete
 delete the copy constructor and assignment operators More...
 
Chronooperator= (const Chrono &)=delete
 

Private Attributes

ChronoEntitym_chrono = nullptr
 The actual chronometer. More...
 

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 35 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
Parameters
svcpointer to Chrono Service
tagthe unique tag

Definition at line 59 of file Chrono.h.

61  {
62  if ( svc ) { m_chrono = svc->chronoStart( tag ); }
63  }

◆ Chrono() [2/6]

Chrono::Chrono ( Chrono &&  rhs)
inline

Move Constructor.

Definition at line 69 of file Chrono.h.

69  {
70  m_chrono = rhs.m_chrono;
71  rhs.m_chrono = nullptr;
72  }

◆ 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 96 of file Chrono.h.

98  {
99  if ( svc ) { m_chrono = svc->chronoStart( tag ); }
100  }

◆ 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
Parameters
cthe pointer to Chrono Object/Entity

Definition at line 122 of file Chrono.h.

122  : m_chrono( c ) {
123  if ( m_chrono ) { m_chrono->start(); }
124  }

◆ 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 146 of file Chrono.h.

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

◆ ~Chrono()

Chrono::~Chrono ( )
inline

Destructor , stop the chrono.

Definition at line 149 of file Chrono.h.

149  {
150  if ( m_chrono ) { m_chrono->stop(); }
151  }

◆ Chrono() [6/6]

Chrono::Chrono ( const Chrono )
privatedelete

delete the copy constructor and assignment operators

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 162 of file Chrono.h.


The documentation for this class was generated from the following file:
ChronoEntity
Definition: ChronoEntity.h:31
ChronoEntity::stop
IChronoSvc::ChronoStatus stop()
stop the chrono
Definition: ChronoEntity.cpp:61
gaudirun.c
c
Definition: gaudirun.py:525
ChronoEntity::start
IChronoSvc::ChronoStatus start()
start the current chrono
Definition: ChronoEntity.cpp:46
Chrono::m_chrono
ChronoEntity * m_chrono
The actual chronometer.
Definition: Chrono.h:162
Chrono
Definition: Chrono.h:35
IChronoSvc
Definition: IChronoSvc.h:41
IChronoSvc::chronoStart
virtual ChronoEntity * chronoStart(const ChronoTag &t)=0
start chrono, tagged by its name
Gaudi::Functional::details::put
auto put(const DataObjectHandle< Out1 > &out_handle, Out2 &&out)
Definition: details.h:168