VTK  9.3.1
vtkExecutionTimer.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
3 
23 #ifndef vtkExecutionTimer_h
24 #define vtkExecutionTimer_h
25 
26 #include "vtkFiltersCoreModule.h" // For export macro
27 #include "vtkObject.h"
28 
29 VTK_ABI_NAMESPACE_BEGIN
30 class vtkAlgorithm;
31 class vtkCallbackCommand;
32 
33 class VTKFILTERSCORE_EXPORT vtkExecutionTimer : public vtkObject
34 {
35 public:
36  vtkTypeMacro(vtkExecutionTimer, vtkObject);
37  void PrintSelf(ostream& os, vtkIndent indent) override;
38 
43  static vtkExecutionTimer* New();
44 
46 
52  void SetFilter(vtkAlgorithm* filter);
53  vtkGetObjectMacro(Filter, vtkAlgorithm);
55 
57 
62  vtkGetMacro(ElapsedCPUTime, double);
64 
66 
71  vtkGetMacro(ElapsedWallClockTime, double);
73 
74 protected:
76  ~vtkExecutionTimer() override;
77 
78  // This is the observer that will catch StartEvent and hand off to
79  // EventRelay
81 
82  // This is the filter that will be timed
84 
85  // These are where we keep track of the timestamps for start/end
86  double CPUStartTime;
87  double CPUEndTime;
88 
91 
94 
96 
101  void StartTimer();
102  void StopTimer();
104 
109  virtual void TimerFinished();
110 
116  static void EventRelay(
117  vtkObject* caller, unsigned long eventId, void* clientData, void* callData);
118 
119 private:
120  vtkExecutionTimer(const vtkExecutionTimer&) = delete;
121  void operator=(const vtkExecutionTimer&) = delete;
122 };
123 
124 VTK_ABI_NAMESPACE_END
125 #endif
abstract base class for most VTK objects
Definition: vtkObject.h:51
vtkCallbackCommand * Callback
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
supports function callbacks
Superclass for all sources, filters, and sinks in VTK.
Definition: vtkAlgorithm.h:51
vtkAlgorithm * Filter
a simple class to control print indentation
Definition: vtkIndent.h:28
Time filter execution.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...