00001 // @(#)root/base:$Name: $:$Id: TBenchmark.h,v 1.4 2000/12/13 15:13:45 brun Exp $ 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 00019 // // 00020 // TBenchmark // 00021 // // 00022 // This class is a ROOT utility to help benchmarking applications // 00023 // // 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 public: 00045 TBenchmark(); 00046 virtual ~TBenchmark(); 00047 Int_t GetBench(const char *name) const; 00048 Float_t GetCpuTime(const char *name); 00049 Float_t GetRealTime(const char *name); 00050 virtual void Print(Option_t *name) const; 00051 virtual void Reset(); 00052 virtual void Show(const char *name); 00053 virtual void Start(const char *name); 00054 virtual void Stop(const char *name); 00055 virtual void Summary(Float_t &rt, Float_t &cp); 00056 00057 ClassDef(TBenchmark,0) //ROOT utility to help benchmarking applications 00058 }; 00059 00060 R__EXTERN TBenchmark *gBenchmark; 00061 00062 #endif
1.2.16