VTK
vtkExecutionTimer.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkAppendFilter.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
35#ifndef vtkExecutionTimer_h
36#define vtkExecutionTimer_h
37
38#include "vtkObject.h"
39#include "vtkFiltersCoreModule.h" // For export macro
40
41class vtkAlgorithm;
43
44class VTKFILTERSCORE_EXPORT vtkExecutionTimer : public vtkObject
45{
46public:
48 void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
49
55
57
63 void SetFilter(vtkAlgorithm* filter);
64 vtkGetObjectMacro(Filter, vtkAlgorithm);
66
68
73 vtkGetMacro(ElapsedCPUTime, double);
75
77
82 vtkGetMacro(ElapsedWallClockTime, double);
84
85protected:
87 ~vtkExecutionTimer() VTK_OVERRIDE;
88
89 // This is the observer that will catch StartEvent and hand off to
90 // EventRelay
92
93 // This is the filter that will be timed
94 vtkAlgorithm* Filter;
95
96 // These are where we keep track of the timestamps for start/end
97 double CPUStartTime;
98 double CPUEndTime;
99
100 double WallClockStartTime;
101 double WallClockEndTime;
102
103 double ElapsedCPUTime;
104 double ElapsedWallClockTime;
105
107
112 void StartTimer();
113 void StopTimer();
115
120 virtual void TimerFinished();
121
127 static void EventRelay(vtkObject* caller, unsigned long eventId, void* clientData, void* callData);
128
129private:
130 vtkExecutionTimer(const vtkExecutionTimer&) VTK_DELETE_FUNCTION;
131 void operator=(const vtkExecutionTimer&) VTK_DELETE_FUNCTION;
132
133};
134
135#endif
Superclass for all sources, filters, and sinks in VTK.
Definition: vtkAlgorithm.h:60
supports function callbacks
Time filter execution.
~vtkExecutionTimer() override
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static vtkExecutionTimer * New()
Construct a new timer with no attached filter.
void SetFilter(vtkAlgorithm *filter)
Set/get the filter to be monitored.
a simple class to control print indentation
Definition: vtkIndent.h:40
abstract base class for most VTK objects
Definition: vtkObject.h:60