VTK  9.7.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 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
29 
30 VTK_ABI_NAMESPACE_BEGIN
31 class vtkAlgorithm;
32 class vtkCallbackCommand;
33 
34 class VTKFILTERSCORE_EXPORT VTK_MARSHALAUTO vtkExecutionTimer : public vtkObject
35 {
36 public:
37  vtkTypeMacro(vtkExecutionTimer, vtkObject);
38  void PrintSelf(ostream& os, vtkIndent indent) override;
39 
44  static vtkExecutionTimer* New();
45 
47 
53  void SetFilter(vtkAlgorithm* filter);
54  vtkGetObjectMacro(Filter, vtkAlgorithm);
56 
58 
63  vtkGetMacro(ElapsedCPUTime, double);
65 
67 
72  vtkGetMacro(ElapsedWallClockTime, double);
74 
75 protected:
77  ~vtkExecutionTimer() override;
78 
79  // This is the observer that will catch StartEvent and hand off to
80  // EventRelay
82 
83  // This is the filter that will be timed
85 
86  // These are where we keep track of the timestamps for start/end
87  double CPUStartTime;
88  double CPUEndTime;
89 
92 
95 
97 
102  void StartTimer();
103  void StopTimer();
105 
110  virtual void TimerFinished();
111 
117  static void EventRelay(
118  vtkObject* caller, unsigned long eventId, void* clientData, void* callData);
119 
120 private:
121  vtkExecutionTimer(const vtkExecutionTimer&) = delete;
122  void operator=(const vtkExecutionTimer&) = delete;
123 };
124 
125 VTK_ABI_NAMESPACE_END
126 #endif
abstract base class for most VTK objects
Definition: vtkObject.h:52
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:53
vtkAlgorithm * Filter
a simple class to control print indentation
Definition: vtkIndent.h:28
Time filter execution.
#define VTK_MARSHALAUTO
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...