12 #ifndef ROOT_TStopwatch
13 #define ROOT_TStopwatch
28 class TStopwatch :
public TObject {
31 enum EState { kUndefined, kStopped, kRunning };
33 Double_t fStartRealTime;
34 Double_t fStopRealTime;
35 Double_t fStartCpuTime;
36 Double_t fStopCpuTime;
37 Double_t fTotalCpuTime;
38 Double_t fTotalRealTime;
42 static Double_t GetRealTime();
43 static Double_t GetCPUTime();
47 void Start(Bool_t reset = kTRUE);
50 Int_t Counter()
const {
return fCounter; }
52 void Reset() { ResetCpuTime(); ResetRealTime(); }
53 void ResetCpuTime(Double_t time = 0) { Stop(); fTotalCpuTime = time; }
54 void ResetRealTime(Double_t time = 0) { Stop(); fTotalRealTime = time; }
56 void Print(Option_t *option=
"")
const;
58 ClassDef(TStopwatch,1)