VTK
vtkOpenGLRenderTimer.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkOpenGLRenderTimer.h
5
6 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7 All rights reserved.
8 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9
10 This software is distributed WITHOUT ANY WARRANTY; without even
11 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12 PURPOSE. See the above copyright notice for more information.
13
14=========================================================================*/
15
30#ifndef vtkOpenGLRenderTimer_h
31#define vtkOpenGLRenderTimer_h
32
33#include "vtkRenderingOpenGL2Module.h" // For export macro
34#include "vtkType.h" // For vtkTypeUint64, etc
35
36class VTKRENDERINGOPENGL2_EXPORT vtkOpenGLRenderTimer
37{
38public:
41
45 void Reset();
46
50 void Start();
51
55 void Stop();
56
60 bool Started();
61
65 bool Stopped();
66
70 bool Ready();
71
73
78 vtkTypeUInt64 GetElapsedNanoseconds();
80
81protected:
84
85 vtkTypeUInt32 StartQuery;
86 vtkTypeUInt32 EndQuery;
87
88 vtkTypeUInt64 StartTime;
89 vtkTypeUInt64 EndTime;
90
91private:
92 vtkOpenGLRenderTimer(const vtkOpenGLRenderTimer&) VTK_DELETE_FUNCTION;
93 void operator=(const vtkOpenGLRenderTimer&) VTK_DELETE_FUNCTION;
94};
95
96#endif // vtkOpenGLRenderTimer_h
97
98// VTK-HeaderTest-Exclude: vtkOpenGLRenderTimer.h
Asynchronously measures GPU execution time.
void Reset()
Clear out any previous results and prepare for a new query.
bool Stopped()
Returns true if the timer has been stopped.
bool Started()
Returns true if the timer has been started.
vtkTypeUInt64 GetElapsedNanoseconds()
void Start()
Mark the start of a timed event.
float GetElapsedMilliseconds()
void Stop()
Mark the end of a timed event.
float GetElapsedSeconds()
If Ready() returns true, get the elapsed time in the requested units.
bool Ready()
Returns true when the timing results are available.