Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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{
34private:
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
43public:
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 Double_t
Definition RtypesCore.h:59
#define ClassDef(name, id)
Definition Rtypes.h:325
Stopwatch object for timing GL work.
Double_t fLastRun
end time (millisec)
TGLStopwatch()
Construct stopwatch object.
void Start()
Start timing.
Double_t fStart
Double_t Lap() const
Return lap time since Start(), in milliseconds.
Double_t fEnd
start time (millisec)
Double_t GetClock(void) const
time of last run (milisec)
Double_t End()
End timing, return total time since Start(), in milliseconds.
virtual ~TGLStopwatch()
Destroy stopwatch object.
Double_t LastRun() const