9#include "BesTimerSvc/BesTimer.h"
11#define SecsInDay 86400
15 m_numberOfMeasurements = 0;
23 m_meanTimePerObject = 0.0;
24 m_NmeanTimePerObject = 0;
42 if (!m_started)
return;
51 if (tv.tv_sec >= m_startTime.tv_sec) {
52 secs = tv.tv_sec - m_startTime.tv_sec;
54 secs = tv.tv_sec - m_startTime.tv_sec +
SecsInDay;
56 usecs = tv.tv_usec - m_startTime.tv_usec;
57 mtime =
static_cast<float>(secs)*1000. +
static_cast<float>(usecs)/1000.;
65 double denom =
static_cast <double> (++m_numberOfMeasurements);
66 double d = m_elapsed -
m_mean;
68 double dd = m_elapsed*m_elapsed - m_ms;
72 m_meanVal +=
static_cast <double> (m_propVal - m_meanVal) / denom;
74 double timePerObject = m_elapsed/
static_cast <double>(m_propVal);
75 m_meanTimePerObject +=
static_cast <double> (timePerObject - m_meanTimePerObject) /
76 static_cast<double> (++m_NmeanTimePerObject);
85 if (m_paused || !m_started)
return;
92 if (tv.tv_sec >= m_startTime.tv_sec) {
93 secs = tv.tv_sec - m_startTime.tv_sec;
95 secs = tv.tv_sec - m_startTime.tv_sec +
SecsInDay;
97 usecs = tv.tv_usec - m_startTime.tv_usec;
98 mtime =
static_cast<float>(secs)*1000. +
static_cast<float>(usecs)/1000.;
107 }
else if (m_paused) {
109 gettimeofday(&tv, 0);
BesTimer(const std::string name)