Logo ROOT  
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 #include "TNamed.h"
27 #include "TStopwatch.h"
28 
29 class TBenchmark : public TNamed {
30 
31 protected:
32 
33  Int_t fNbench; // Number of active benchmarks
34  Int_t fNmax; // Maximum number of benchmarks initialized
35  TString *fNames; //[fNbench] Names of benchmarks
36  Float_t *fRealTime; //[fNbench] Real Time
37  Float_t *fCpuTime; //[fNbench] Cpu Time
38  TStopwatch *fTimer; // Timers
39 
40  TBenchmark(const TBenchmark&);
42 
43 public:
44  TBenchmark();
45  virtual ~TBenchmark();
46  Int_t GetBench(const char *name) const;
47  Float_t GetCpuTime(const char *name);
48  Float_t GetRealTime(const char *name);
49  virtual void Print(Option_t *name="") const;
50  virtual void Reset();
51  virtual void Show(const char *name);
52  virtual void Start(const char *name);
53  virtual void Stop(const char *name);
54  virtual void Summary(Float_t &rt, Float_t &cp);
55 
56  ClassDef(TBenchmark,0) //ROOT utility to help benchmarking applications
57 };
58 
60 
61 #endif
TBenchmark
This class is a ROOT utility to help benchmarking applications.
Definition: TBenchmark.h:29
TBenchmark::fNmax
Int_t fNmax
Definition: TBenchmark.h:34
TBenchmark::Stop
virtual void Stop(const char *name)
Terminates Benchmark with specified name.
Definition: TBenchmark.cxx:201
Option_t
const char Option_t
Definition: RtypesCore.h:66
TBenchmark::fCpuTime
Float_t * fCpuTime
Definition: TBenchmark.h:37
TBenchmark::Start
virtual void Start(const char *name)
Starts Benchmark with the specified name.
Definition: TBenchmark.cxx:172
TBenchmark::operator=
TBenchmark & operator=(const TBenchmark &)
Assignment operator.
Definition: TBenchmark.cxx:64
TBenchmark::fTimer
TStopwatch * fTimer
Definition: TBenchmark.h:38
TStopwatch.h
TNamed.h
Float_t
float Float_t
Definition: RtypesCore.h:57
TString
Basic string class.
Definition: TString.h:136
TBenchmark::Print
virtual void Print(Option_t *name="") const
Prints parameters of Benchmark name.
Definition: TBenchmark.cxx:137
TBenchmark::GetBench
Int_t GetBench(const char *name) const
Returns index of Benchmark name.
Definition: TBenchmark.cxx:106
TBenchmark::TBenchmark
TBenchmark()
Benchmark default constructor.
Definition: TBenchmark.cxx:26
TBenchmark::Summary
virtual void Summary(Float_t &rt, Float_t &cp)
Prints a summary of all benchmarks.
Definition: TBenchmark.cxx:214
TNamed
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:29
gBenchmark
R__EXTERN TBenchmark * gBenchmark
Definition: TBenchmark.h:59
TBenchmark::Reset
virtual void Reset()
Reset all Benchmarks.
Definition: TBenchmark.cxx:147
TBenchmark::fNames
TString * fNames
Definition: TBenchmark.h:35
TBenchmark::fNbench
Int_t fNbench
Definition: TBenchmark.h:33
TBenchmark::GetCpuTime
Float_t GetCpuTime(const char *name)
Returns Cpu time used by Benchmark name.
Definition: TBenchmark.cxx:117
TBenchmark::GetRealTime
Float_t GetRealTime(const char *name)
Returns Realtime used by Benchmark name.
Definition: TBenchmark.cxx:127
TStopwatch
Stopwatch class.
Definition: TStopwatch.h:28
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
name
char name[80]
Definition: TGX11.cxx:110
TBenchmark::~TBenchmark
virtual ~TBenchmark()
Benchmark destructor.
Definition: TBenchmark.cxx:94
R__EXTERN
#define R__EXTERN
Definition: DllImport.h:27
TBenchmark::Show
virtual void Show(const char *name)
Stops Benchmark name and Prints results.
Definition: TBenchmark.cxx:155
TBenchmark::fRealTime
Float_t * fRealTime
Definition: TBenchmark.h:36
int