| # Gaudi Framework, version v20r2
Generated: 18 Jul 2008

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

- Search for |

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# Chrono Class Reference

`#include <Chrono.h>`

Collaboration diagram for Chrono:

[legend]
List of all members.

## 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.

## Public Member Functions
| Chrono (IChronoSvc *svc=0, const std::string &tag="CHRONO::UNNAMED")
| Constructor from Chrono Service and the tag.
| 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 &)
| the copy constructor is disabled
Chrono & | operator= (const Chrono &)
| the assignemet operator is disabled
## Private Attributes
ChronoEntity * | m_chrono
| The actual chronometer.

## Constructor & Destructor Documentation

Chrono::Chrono | ( | IChronoSvc * | svc = `0`,
|  | 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 53 of file Chrono.h.

References m_chrono.

    00055     : m_chrono ( 0 )
    00056   { if ( 0 != svc ) { m_chrono = svc -> chronoStart ( tag ) ; } }

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

References m_chrono.

    00082     : m_chrono ( 0 )
    00083   { if ( 0 != svc ) { m_chrono = svc -> chronoStart ( tag ) ; } }

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

References m_chrono.

    00105                              : m_chrono ( c )
    00106   { if ( 0 != m_chrono ) { m_chrono -> start () ; } }

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

References m_chrono.

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

Chrono::~Chrono | ( |  | ) | `[inline]`

Destructor , stop the chrono.

Definition at line 131 of file Chrono.h.

References m_chrono, and ChronoEntity::stop().

    00131 { if ( 0 != m_chrono ) { m_chrono->stop() ; } }

Chrono::Chrono | ( | const Chrono & |  | ) | `[private]`

the copy constructor is disabled

## Member Function Documentation

Chrono& Chrono::operator= | ( | const Chrono & |  | ) | `[private]`

the assignemet operator is disabled

## Member Data Documentation

ChronoEntity* Chrono::m_chrono`[private]`

The actual chronometer.

Definition at line 143 of file Chrono.h.

Referenced by Chrono(), and ~Chrono().

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

- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v20r2/GaudiKernel/v25r2/GaudiKernel/Chrono.h