00001 // @(#)root/base:$Id: TBenchmark.h 20877 2007-11-19 11:17:07Z rdm $ 00002 // Author: Rene Brun 12/12/94 00003 00004 /************************************************************************* 00005 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. * 00006 * All rights reserved. * 00007 * * 00008 * For the licensing terms see $ROOTSYS/LICENSE. * 00009 * For the list of contributors see $ROOTSYS/README/CREDITS. * 00010 *************************************************************************/ 00011 // ---------------------------------- Benchmark.h 00012 00013 #ifndef ROOT_TBenchmark 00014 #define ROOT_TBenchmark 00015 00016 00017 00018 ////////////////////////////////////////////////////////////////////////// 00019 // // 00020 // TBenchmark // 00021 // // 00022 // This class is a ROOT utility to help benchmarking applications // 00023 // // 00024 ////////////////////////////////////////////////////////////////////////// 00025 00026 #ifndef ROOT_TNamed 00027 #include "TNamed.h" 00028 #endif 00029 #ifndef ROOT_TStopwatch 00030 #include "TStopwatch.h" 00031 #endif 00032 00033 class TBenchmark : public TNamed { 00034 00035 protected: 00036 00037 Int_t fNbench; // Number of active benchmarks 00038 Int_t fNmax; // Maximum number of benchmarks initialized 00039 TString *fNames; //[fNbench] Names of benchmarks 00040 Float_t *fRealTime; //[fNbench] Real Time 00041 Float_t *fCpuTime; //[fNbench] Cpu Time 00042 TStopwatch *fTimer; // Timers 00043 00044 TBenchmark(const TBenchmark&); 00045 TBenchmark& operator=(const TBenchmark&); 00046 00047 public: 00048 TBenchmark(); 00049 virtual ~TBenchmark(); 00050 Int_t GetBench(const char *name) const; 00051 Float_t GetCpuTime(const char *name); 00052 Float_t GetRealTime(const char *name); 00053 virtual void Print(Option_t *name="") const; 00054 virtual void Reset(); 00055 virtual void Show(const char *name); 00056 virtual void Start(const char *name); 00057 virtual void Stop(const char *name); 00058 virtual void Summary(Float_t &rt, Float_t &cp); 00059 00060 ClassDef(TBenchmark,0) //ROOT utility to help benchmarking applications 00061 }; 00062 00063 R__EXTERN TBenchmark *gBenchmark; 00064 00065 #endif