TBenchmark+

系统自带计时

继承 TNamed

class

Int_t              GetBench(const char *name) const;
Float_t            GetCpuTime(const char *name);
Float_t            GetRealTime(const char *name);
virtual void       Print(Option_t *name="") const;
virtual void       Reset();
virtual void       Show(const char *name);
virtual void       Start(const char *name);
virtual void       Stop(const char *name);
virtual void       Summary(Float_t &rt, Float_t &cp);
R__EXTERN TBenchmark  *gBenchmark;

code

gBenchmark->Start("tree");
gBenchmark->Show("tree");
//输出格式如下:tree      : Real Time =   0.55 seconds Cpu Time =   0.17 seconds