34 #ifndef I_BESStopWatch_h
35 #define I_BESStopWatch_h 1
38 #include "sys/resource.h"
45 #define TIMING_LOG "timing"
46 #define MISSING_LOG_PARAM ""
50 namespace bes_timing {
58 std::string _timer_name;
60 std::string _log_name;
64 struct rusage _start_usage ;
65 struct rusage _stop_usage ;
66 struct timeval _result ;
68 bool timeval_subtract() ;
76 _req_id(MISSING_LOG_PARAM),
77 _log_name(TIMING_LOG),
88 BESStopWatch(std::string logName) : _timer_name(MISSING_LOG_PARAM),
89 _req_id(MISSING_LOG_PARAM),
111 virtual bool start(std::string name) ;
121 virtual bool start(std::string name, std::string reqID) ;
123 virtual void dump( std::ostream &strm )
const ;
126 #endif // I_BESStopWatch_h