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