Logo ROOT   6.18/05
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
29class TBenchmark : public TNamed {
30
31protected:
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
43public:
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
#define R__EXTERN
Definition: DllImport.h:27
int Int_t
Definition: RtypesCore.h:41
float Float_t
Definition: RtypesCore.h:53
const char Option_t
Definition: RtypesCore.h:62
#define ClassDef(name, id)
Definition: Rtypes.h:326
R__EXTERN TBenchmark * gBenchmark
Definition: TBenchmark.h:59
char name[80]
Definition: TGX11.cxx:109
This class is a ROOT utility to help benchmarking applications.
Definition: TBenchmark.h:29
virtual void Print(Option_t *name="") const
Prints parameters of Benchmark name.
Definition: TBenchmark.cxx:139
Int_t fNmax
Definition: TBenchmark.h:34
TStopwatch * fTimer
Definition: TBenchmark.h:38
virtual void Reset()
Reset all Benchmarks.
Definition: TBenchmark.cxx:149
Int_t fNbench
Definition: TBenchmark.h:33
virtual void Summary(Float_t &rt, Float_t &cp)
Prints a summary of all benchmarks.
Definition: TBenchmark.cxx:216
TBenchmark()
Benchmark default constructor.
Definition: TBenchmark.cxx:28
Int_t GetBench(const char *name) const
Returns index of Benchmark name.
Definition: TBenchmark.cxx:108
virtual void Start(const char *name)
Starts Benchmark with the specified name.
Definition: TBenchmark.cxx:174
Float_t * fCpuTime
Definition: TBenchmark.h:37
TString * fNames
Definition: TBenchmark.h:35
Float_t * fRealTime
Definition: TBenchmark.h:36
TBenchmark & operator=(const TBenchmark &)
Assignment operator.
Definition: TBenchmark.cxx:66
virtual void Stop(const char *name)
Terminates Benchmark with specified name.
Definition: TBenchmark.cxx:203
virtual ~TBenchmark()
Benchmark destructor.
Definition: TBenchmark.cxx:96
virtual void Show(const char *name)
Stops Benchmark name and Prints results.
Definition: TBenchmark.cxx:157
Float_t GetCpuTime(const char *name)
Returns Cpu time used by Benchmark name.
Definition: TBenchmark.cxx:119
Float_t GetRealTime(const char *name)
Returns Realtime used by Benchmark name.
Definition: TBenchmark.cxx:129
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:29
Stopwatch class.
Definition: TStopwatch.h:28
Basic string class.
Definition: TString.h:131