xrootd
|
#include <XrdMonTimer.hh>
Public Member Functions | |
XrdMonTimer () | |
void | reset () |
int | start () |
double | stop () |
double | getElapsed () const |
void | printElapsed (const char *str) |
void | printAll () const |
Private Member Functions | |
void | resetTBeg () |
void | resetTElapsed () |
double | calcElapsed () |
int | timerOn () const |
int | isOn (const struct timeval &t) const |
double | calcDif (const struct timeval &start, const struct timeval &stop) const |
void | printOne (const timeval &t, const char *prefix=0) const |
double | convert2Double (const timeval &t) const |
Private Attributes | |
struct timeval | _tbeg |
double | _elapsed |
XrdMonTimer::XrdMonTimer | ( | ) | [inline] |
References reset().
double XrdMonTimer::calcDif | ( | const struct timeval & | start, |
const struct timeval & | stop | ||
) | const [inline, private] |
References convert2Double().
Referenced by calcElapsed().
double XrdMonTimer::calcElapsed | ( | ) | [inline, private] |
Calculates elapsed time (from last "start" till now) and adds it to the current total elapsed time. Return elapsed time on success (or -1)
References _elapsed, _tbeg, calcDif(), gettimeofday(), and timerOn().
Referenced by printElapsed(), and stop().
double XrdMonTimer::convert2Double | ( | const timeval & | t | ) | const [inline, private] |
Referenced by calcDif(), and printOne().
double XrdMonTimer::getElapsed | ( | ) | const [inline] |
Returns total elapsed time (sum of deltas between all "starts" and "stops"). If counter is currently started and not stopped that interval will not be included.
References _elapsed.
int XrdMonTimer::isOn | ( | const struct timeval & | t | ) | const [inline, private] |
Referenced by timerOn().
void XrdMonTimer::printAll | ( | ) | const |
References _elapsed, _tbeg, and printOne().
void XrdMonTimer::printElapsed | ( | const char * | str | ) |
References calcElapsed().
void XrdMonTimer::printOne | ( | const timeval & | t, |
const char * | prefix = 0 |
||
) | const [private] |
References convert2Double().
Referenced by printAll().
void XrdMonTimer::reset | ( | ) | [inline] |
References resetTBeg(), and resetTElapsed().
Referenced by printSpeed(), and XrdMonTimer().
void XrdMonTimer::resetTBeg | ( | ) | [inline, private] |
int XrdMonTimer::start | ( | ) | [inline] |
Starts the timer. Returns 0 on success.
References _tbeg, gettimeofday(), and timerOn().
Referenced by main(), and printSpeed().
double XrdMonTimer::stop | ( | ) | [inline] |
Stops the timer. Returns total elapsed time (sum of all deltas between "starts" and "stops"), or -1 on error.
References _elapsed, calcElapsed(), resetTBeg(), and timerOn().
Referenced by main(), and printSpeed().
int XrdMonTimer::timerOn | ( | ) | const [inline, private] |
Referenced by calcElapsed(), start(), and stop().
double XrdMonTimer::_elapsed [private] |
Referenced by calcElapsed(), getElapsed(), printAll(), resetTElapsed(), and stop().
struct timeval XrdMonTimer::_tbeg [private] |
Referenced by calcElapsed(), printAll(), resetTBeg(), start(), and timerOn().