Logo ROOT   6.10/09
Reference Guide
TGLStopwatch.h
Go to the documentation of this file.
1 // @(#)root/gl:$Id$
2 // Author: Richard Maunder 25/05/2005
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2004, 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 
12 #ifndef ROOT_TGLStopwatch
13 #define ROOT_TGLStopwatch
14 
15 #include "Rtypes.h"
16 
17 //////////////////////////////////////////////////////////////////////////
18 // //
19 // TGLStopwatch //
20 // //
21 // Stopwatch object for timing GL work. We do not use the TStopwatch as //
22 // we need to perform GL flushing to get accurate times + we record //
23 // timing overheads here. //
24 //
25 // MT: Bypassed all of the overhead stuff. It does not seem reasonable
26 // anyway. Besides it was being initialized outside of a valid GL
27 // context and coused random crashes (especially on 64-bit machines with
28 // nvidia cards).
29 //
30 //////////////////////////////////////////////////////////////////////////
31 
33 {
34 private:
35  // Fields
36  Double_t fStart; //! start time (millisec)
37  Double_t fEnd; //! end time (millisec)
38  Double_t fLastRun; //! time of last run (milisec)
39 
40  // Methods
41  Double_t GetClock(void) const;
42 
43 public:
44  TGLStopwatch();
45  virtual ~TGLStopwatch(); // ClassDef introduces virtual fns
46 
47  void Start();
48  Double_t Lap() const;
49  Double_t End();
50  Double_t LastRun() const { return fLastRun; }
51 
52  ClassDef(TGLStopwatch,0) // a GL stopwatch utility class
53 };
54 
55 #endif // ROOT_TGLStopwatch
Double_t LastRun() const
Definition: TGLStopwatch.h:50
Double_t fEnd
start time (millisec)
Definition: TGLStopwatch.h:37
void Start()
Start timing.
Stopwatch object for timing GL work.
Definition: TGLStopwatch.h:32
#define ClassDef(name, id)
Definition: Rtypes.h:297
TGLStopwatch()
Construct stopwatch object.
Double_t Lap() const
Return lap time since Start(), in milliseconds.
Double_t fStart
Definition: TGLStopwatch.h:36
double Double_t
Definition: RtypesCore.h:55
Double_t fLastRun
end time (millisec)
Definition: TGLStopwatch.h:38
virtual ~TGLStopwatch()
Destroy stopwatch object.
Double_t End()
End timing, return total time since Start(), in milliseconds.
Double_t GetClock(void) const
time of last run (milisec)