VTK  9.0.20210121
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 
32 #ifndef vtkExecutionTimer_h
33 #define vtkExecutionTimer_h
34 
35 #include "vtkFiltersCoreModule.h" // For export macro
36 #include "vtkObject.h"
37 
38 class vtkAlgorithm;
39 class vtkCallbackCommand;
40 
41 class VTKFILTERSCORE_EXPORT vtkExecutionTimer : public vtkObject
42 {
43 public:
44  vtkTypeMacro(vtkExecutionTimer, vtkObject);
45  void PrintSelf(ostream& os, vtkIndent indent) override;
46 
51  static vtkExecutionTimer* New();
52 
54 
60  void SetFilter(vtkAlgorithm* filter);
61  vtkGetObjectMacro(Filter, vtkAlgorithm);
63 
65 
70  vtkGetMacro(ElapsedCPUTime, double);
72 
74 
79  vtkGetMacro(ElapsedWallClockTime, double);
81 
82 protected:
84  ~vtkExecutionTimer() override;
85 
86  // This is the observer that will catch StartEvent and hand off to
87  // EventRelay
89 
90  // This is the filter that will be timed
92 
93  // These are where we keep track of the timestamps for start/end
94  double CPUStartTime;
95  double CPUEndTime;
96 
99 
102 
104 
109  void StartTimer();
110  void StopTimer();
112 
117  virtual void TimerFinished();
118 
124  static void EventRelay(
125  vtkObject* caller, unsigned long eventId, void* clientData, void* callData);
126 
127 private:
128  vtkExecutionTimer(const vtkExecutionTimer&) = delete;
129  void operator=(const vtkExecutionTimer&) = delete;
130 };
131 
132 #endif
vtkAlgorithm
Superclass for all sources, filters, and sinks in VTK.
Definition: vtkAlgorithm.h:63
vtkObject::New
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:62
vtkExecutionTimer::CPUEndTime
double CPUEndTime
Definition: vtkExecutionTimer.h:95
vtkExecutionTimer::WallClockEndTime
double WallClockEndTime
Definition: vtkExecutionTimer.h:98
vtkExecutionTimer::Filter
vtkAlgorithm * Filter
Definition: vtkExecutionTimer.h:91
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkObject::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkObject.h
vtkExecutionTimer::ElapsedCPUTime
double ElapsedCPUTime
Definition: vtkExecutionTimer.h:100
vtkExecutionTimer
Time filter execution.
Definition: vtkExecutionTimer.h:41
vtkCallbackCommand
supports function callbacks
Definition: vtkCallbackCommand.h:44
vtkExecutionTimer::ElapsedWallClockTime
double ElapsedWallClockTime
Definition: vtkExecutionTimer.h:101
vtkExecutionTimer::CPUStartTime
double CPUStartTime
Definition: vtkExecutionTimer.h:94
vtkExecutionTimer::WallClockStartTime
double WallClockStartTime
Definition: vtkExecutionTimer.h:97
vtkExecutionTimer::Callback
vtkCallbackCommand * Callback
Definition: vtkExecutionTimer.h:88