TStopwatch

void        Start(Bool_t reset = kTRUE);
void        Stop();
void        Continue();
Int_t       Counter() const { return fCounter; }
Double_t    RealTime();
void        Reset() { ResetCpuTime(); ResetRealTime(); }
void        ResetCpuTime(Double_t time = 0) { Stop();  fTotalCpuTime = time; }
void        ResetRealTime(Double_t time = 0) { Stop(); fTotalRealTime = time; }
Double_t    CpuTime();
void        Print(Option_t *option="") const;

code

TStopwatch sw;
sw.Start();
printf("CPU: %8.3f\n",sw.CpuTime());