| The Gaudi Framework v30r0 (c919700c)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Private Member Functions | Private Attributes | List of all members
Chrono Class Reference

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

`#include <GaudiKernel/Chrono.h>`

Collaboration diagram for Chrono:
[legend]

## 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...
Chrono & | operator= (const Chrono &)=delete

## Private Attributes
ChronoEntity * | m_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 25 of file Chrono.h.

## Constructor & Destructor Documentation

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

  svc | pointer to Chrono Service
  tag | the unique tag

Definition at line 50 of file Chrono.h.

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

Chrono::Chrono | ( | Chrono && | rhs | ) |
| inline

Move Constructor.

Definition at line 62 of file Chrono.h.

63 {
64 m_chrono = rhs.m_chrono;
65 rhs.m_chrono = nullptr;
66 }
Chrono::m_chrono
ChronoEntity * m_chrono
The actual chronometer.
Definition: Chrono.h:164

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

  tag | the unique tag
  svc | pointer to Chrono Service

Definition at line 90 of file Chrono.h.

92 {
93 if ( svc ) {
94 m_chrono = svc->chronoStart( tag );
95 }
96 }
IChronoSvc::chronoStart
virtual ChronoEntity * chronoStart(const ChronoTag &t)=0
start chrono, tagged by its name
Chrono::m_chrono
ChronoEntity * m_chrono
The actual chronometer.
Definition: Chrono.h:164

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

  c | the pointer to Chrono Object/Entity

Definition at line 118 of file Chrono.h.

118 : m_chrono( c )
119 {
120 if ( m_chrono ) {
121 m_chrono->start();
122 }
123 }
ChronoEntity::start
IChronoSvc::ChronoStatus start()
start the current chrono
Definition: ChronoEntity.cpp:47
Chrono::m_chrono
ChronoEntity * m_chrono
The actual chronometer.
Definition: Chrono.h:164

Chrono::Chrono | ( | ChronoEntity & | c | ) |
| inline

Constructor from Chrono Object/Entity.

ChronoEntity m_chrono = ... ;
{ // 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

  c | the reference to Chrono Object/Entity

Definition at line 145 of file Chrono.h.

145 : m_chrono( &c ) { m_chrono->start(); }
ChronoEntity::start
IChronoSvc::ChronoStatus start()
start the current chrono
Definition: ChronoEntity.cpp:47
Chrono::m_chrono
ChronoEntity * m_chrono
The actual chronometer.
Definition: Chrono.h:164

Chrono::~Chrono | ( |  | ) |
| inline

Destructor , stop the chrono.

Definition at line 148 of file Chrono.h.

149 {
150 if ( m_chrono ) {
151 m_chrono->stop();
152 }
153 }
Chrono::m_chrono
ChronoEntity * m_chrono
The actual chronometer.
Definition: Chrono.h:164
ChronoEntity::stop
IChronoSvc::ChronoStatus stop()
stop the chrono
Definition: ChronoEntity.cpp:65

Chrono::Chrono | ( | const Chrono & |  | ) |
| private delete

delete the copy constructor and assignment operators

## Member Function Documentation

Chrono& Chrono::operator= | ( | const Chrono & |  | ) |
| private delete

## Member Data Documentation

ChronoEntity* Chrono::m_chrono = nullptr
| private

The actual chronometer.

Definition at line 164 of file Chrono.h.

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

- GaudiKernel/GaudiKernel/Chrono.h