Version: 6.3.1
Public Member Functions | Protected Attributes

chrono Class Reference

#include <chrono.hxx>

Public Member Functions

 chrono (int i)
 ~chrono ()
void stop ()

Protected Attributes

bool _run
int _ctr
clock_t _start
clock_t _end

Detailed Description

Definition at line 47 of file chrono.hxx.


Constructor & Destructor Documentation

chrono::chrono ( int  i)

Definition at line 62 of file chrono.cxx.

References _start.

                    :
  _ctr(i), _run(true)
{
  //MESSAGE("chrono::chrono " << _ctr << " " << _run);
  _start = clock();
}
chrono::~chrono ( )

Definition at line 69 of file chrono.cxx.

References _run, and stop().

{
  if (_run)
    stop();
}

Member Function Documentation

void chrono::stop ( )

Definition at line 75 of file chrono.cxx.

References _ctr, acnt._ctrCumul, acnt._ctrOccur, counters._ctrs, _end, _run, and _start.

Referenced by ~chrono().

{
  //MESSAGE("chrono::stop " << _ctr << " " << _run);
  if (_run)
    {
      _run = false;
      _end = clock();
      double elapse = double(_end - _start) / double(CLOCKS_PER_SEC);
      counters::_ctrs[_ctr]._ctrOccur++;
      counters::_ctrs[_ctr]._ctrCumul += elapse;
    }
}

Field Documentation

int chrono._ctr [protected]

Definition at line 55 of file chrono.hxx.

Referenced by stop().

clock_t chrono._end [protected]

Definition at line 56 of file chrono.hxx.

Referenced by stop().

bool chrono._run [protected]

Definition at line 54 of file chrono.hxx.

Referenced by stop(), and ~chrono().

clock_t chrono._start [protected]

Definition at line 56 of file chrono.hxx.

Referenced by chrono(), and stop().

Copyright © 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS