ROOT logo
// @(#)root/gl:$Id$
// Author:  Richard Maunder  25/05/2005

/*************************************************************************
 * Copyright (C) 1995-2004, Rene Brun and Fons Rademakers.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

#ifndef ROOT_TGLStopwatch
#define ROOT_TGLStopwatch

#ifndef ROOT_Rtypes
#include "Rtypes.h"
#endif

//////////////////////////////////////////////////////////////////////////
//                                                                      //
// TGLStopwatch                                                         //
//                                                                      //
// Stopwatch object for timing GL work. We do not use the TStopwatch as //
// we need to perform GL flushing to get accurate times + we record     //
// timing overheads here.                                               //
//
// MT: Bypassed all of the overhead stuff. It does not seem reasonable
// anyway. Besides it was being initialized outside of a valid GL
// context and coused random crashes (especially on 64-bit machines with
// nvidia cards).
//
//////////////////////////////////////////////////////////////////////////

class TGLStopwatch
{
private:
   // Fields
   Double_t        fStart;           //! start time (millisec)
   Double_t        fEnd;             //! end time (millisec)
   Double_t        fLastRun;         //! time of last run (milisec)

   // Methods
   Double_t GetClock(void)      const;

public:
   TGLStopwatch();
   virtual ~TGLStopwatch(); // ClassDef introduces virtual fns

   void     Start();
   Double_t Lap() const;
   Double_t End();
   Double_t LastRun() const { return fLastRun; }

   ClassDef(TGLStopwatch,0) // a GL stopwatch utility class
};

#endif // ROOT_TGLStopwatch
 TGLStopwatch.h:1
 TGLStopwatch.h:2
 TGLStopwatch.h:3
 TGLStopwatch.h:4
 TGLStopwatch.h:5
 TGLStopwatch.h:6
 TGLStopwatch.h:7
 TGLStopwatch.h:8
 TGLStopwatch.h:9
 TGLStopwatch.h:10
 TGLStopwatch.h:11
 TGLStopwatch.h:12
 TGLStopwatch.h:13
 TGLStopwatch.h:14
 TGLStopwatch.h:15
 TGLStopwatch.h:16
 TGLStopwatch.h:17
 TGLStopwatch.h:18
 TGLStopwatch.h:19
 TGLStopwatch.h:20
 TGLStopwatch.h:21
 TGLStopwatch.h:22
 TGLStopwatch.h:23
 TGLStopwatch.h:24
 TGLStopwatch.h:25
 TGLStopwatch.h:26
 TGLStopwatch.h:27
 TGLStopwatch.h:28
 TGLStopwatch.h:29
 TGLStopwatch.h:30
 TGLStopwatch.h:31
 TGLStopwatch.h:32
 TGLStopwatch.h:33
 TGLStopwatch.h:34
 TGLStopwatch.h:35
 TGLStopwatch.h:36
 TGLStopwatch.h:37
 TGLStopwatch.h:38
 TGLStopwatch.h:39
 TGLStopwatch.h:40
 TGLStopwatch.h:41
 TGLStopwatch.h:42
 TGLStopwatch.h:43
 TGLStopwatch.h:44
 TGLStopwatch.h:45
 TGLStopwatch.h:46
 TGLStopwatch.h:47
 TGLStopwatch.h:48
 TGLStopwatch.h:49
 TGLStopwatch.h:50
 TGLStopwatch.h:51
 TGLStopwatch.h:52
 TGLStopwatch.h:53
 TGLStopwatch.h:54
 TGLStopwatch.h:55
 TGLStopwatch.h:56
 TGLStopwatch.h:57