| # Gaudi Framework, version v21r11 |

Home |  | Generated: 30 Sep 2010

# Chrono Class Reference

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

`#include <Chrono.h>`

Collaboration diagram for Chrono:
[legend]

List of all members.

## 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 assignment operator is disabled
## Private Attributes
ChronoEntity * | m_chrono
| 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::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.

    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.

    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.

    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.

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

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

Destructor , stop the chrono.

Definition at line 131 of file Chrono.h.

    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 assignment operator is disabled

## Member Data Documentation

ChronoEntity* Chrono::m_chrono`[private]`

The actual chronometer.

Definition at line 143 of file Chrono.h.

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

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