Logo ROOT   6.08/07
Reference Guide
TBenchmark.h
Go to the documentation of this file.
1 // @(#)root/base:$Id$
2 // Author: Rene Brun 12/12/94
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 // ---------------------------------- Benchmark.h
12 
13 #ifndef ROOT_TBenchmark
14 #define ROOT_TBenchmark
15 
16 
17 
18 //////////////////////////////////////////////////////////////////////////
19 // //
20 // TBenchmark //
21 // //
22 // This class is a ROOT utility to help benchmarking applications //
23 // //
24 //////////////////////////////////////////////////////////////////////////
25 
26 #ifndef ROOT_TNamed
27 #include "TNamed.h"
28 #endif
29 #ifndef ROOT_TStopwatch
30 #include "TStopwatch.h"
31 #endif
32 
33 class TBenchmark : public TNamed {
34 
35 protected:
36 
37  Int_t fNbench; // Number of active benchmarks
38  Int_t fNmax; // Maximum number of benchmarks initialized
39  TString *fNames; //[fNbench] Names of benchmarks
40  Float_t *fRealTime; //[fNbench] Real Time
41  Float_t *fCpuTime; //[fNbench] Cpu Time
42  TStopwatch *fTimer; // Timers
43 
44  TBenchmark(const TBenchmark&);
46 
47 public:
48  TBenchmark();
49  virtual ~TBenchmark();
50  Int_t GetBench(const char *name) const;
51  Float_t GetCpuTime(const char *name);
52  Float_t GetRealTime(const char *name);
53  virtual void Print(Option_t *name="") const;
54  virtual void Reset();
55  virtual void Show(const char *name);
56  virtual void Start(const char *name);
57  virtual void Stop(const char *name);
58  virtual void Summary(Float_t &rt, Float_t &cp);
59 
60  ClassDef(TBenchmark,0) //ROOT utility to help benchmarking applications
61 };
62 
64 
65 #endif
TStopwatch * fTimer
Definition: TBenchmark.h:42
TBenchmark()
Benchmark default constructor.
Definition: TBenchmark.cxx:28
Float_t * fRealTime
Definition: TBenchmark.h:40
float Float_t
Definition: RtypesCore.h:53
const char Option_t
Definition: RtypesCore.h:62
TBenchmark & operator=(const TBenchmark &)
Assignment operator.
Definition: TBenchmark.cxx:66
Int_t fNmax
Definition: TBenchmark.h:38
virtual void Show(const char *name)
Stops Benchmark name and Prints results.
Definition: TBenchmark.cxx:157
Basic string class.
Definition: TString.h:137
int Int_t
Definition: RtypesCore.h:41
virtual void Stop(const char *name)
Terminates Benchmark with specified name.
Definition: TBenchmark.cxx:203
virtual void Start(const char *name)
Starts Benchmark with the specified name.
Definition: TBenchmark.cxx:174
#define ClassDef(name, id)
Definition: Rtypes.h:254
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:33
TString * fNames
Definition: TBenchmark.h:39
Float_t * fCpuTime
Definition: TBenchmark.h:41
Float_t GetCpuTime(const char *name)
Returns Cpu time used by Benchmark name.
Definition: TBenchmark.cxx:119
virtual void Print(Option_t *name="") const
Prints parameters of Benchmark name.
Definition: TBenchmark.cxx:139
Float_t GetRealTime(const char *name)
Returns Realtime used by Benchmark name.
Definition: TBenchmark.cxx:129
virtual ~TBenchmark()
Benchmark destructor.
Definition: TBenchmark.cxx:96
R__EXTERN TBenchmark * gBenchmark
Definition: TBenchmark.h:63
This class is a ROOT utility to help benchmarking applications.
Definition: TBenchmark.h:33
Int_t GetBench(const char *name) const
Returns index of Benchmark name.
Definition: TBenchmark.cxx:108
#define R__EXTERN
Definition: DllImport.h:27
virtual void Summary(Float_t &rt, Float_t &cp)
Prints a summary of all benchmarks.
Definition: TBenchmark.cxx:216
Int_t fNbench
Definition: TBenchmark.h:37
virtual void Reset()
Reset all Benchmarks.
Definition: TBenchmark.cxx:149
char name[80]
Definition: TGX11.cxx:109
Stopwatch class.
Definition: TStopwatch.h:30