CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
MyWatcher.h
Go to the documentation of this file.
1 #ifndef MyWATCHER_H
2 #define MyWATCHER_H
3 
4 #include "TStopwatch.h"
5 #include <iostream>
6 #include <sstream>
7 
8 class MyWatcher : public TStopwatch {
9  public:
10  MyWatcher(const std::string n=""):name(n),total(0) {}
12 
13  std::string start(bool r=true){Start(r); return " [Start]";}
14  std::string continu(){Continue(); return " [Continue]";}
15  std::string reset(){Reset(); return " [Reset]";}
16  std::string stop() {Stop(); return " [Stop]";}
17  std::string lap() {
18  std::stringstream o;
19  double r=RealTime();
20  total+=r;
21  o<<"\n "<<r<<" total:"<<total<<" ["<<name<<"]";
22  Start();
23  return o.str();}
24  std::string name;
25  double total;
26 };
27 
28 
29 #endif
std::string start(bool r=true)
Definition: MyWatcher.h:13
std::string lap()
Definition: MyWatcher.h:17
std::string name
Definition: MyWatcher.h:24
MyWatcher(const std::string n="")
Definition: MyWatcher.h:10
std::string stop()
Definition: MyWatcher.h:16
~MyWatcher()
Definition: MyWatcher.h:11
std::string continu()
Definition: MyWatcher.h:14
double total
Definition: MyWatcher.h:25
std::string reset()
Definition: MyWatcher.h:15
void Reset(std::vector< TH2F > &depth)