VTK  9.5.20250913
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
30VTK_ABI_NAMESPACE_BEGIN
31class vtkAlgorithm;
33
34class VTKFILTERSCORE_EXPORT VTK_MARSHALAUTO vtkExecutionTimer : public vtkObject
35{
36public:
38 void PrintSelf(ostream& os, vtkIndent indent) override;
39
45
47
53 void SetFilter(vtkAlgorithm* filter);
54 vtkGetObjectMacro(Filter, vtkAlgorithm);
56
58
63 vtkGetMacro(ElapsedCPUTime, double);
65
67
72 vtkGetMacro(ElapsedWallClockTime, double);
74
75protected:
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
88 double CPUEndTime;
89
92
95
97
103 void StopTimer();
105
110 virtual void TimerFinished();
111
117 static void EventRelay(
118 vtkObject* caller, unsigned long eventId, void* clientData, void* callData);
119
120private:
121 vtkExecutionTimer(const vtkExecutionTimer&) = delete;
122 void operator=(const vtkExecutionTimer&) = delete;
123};
124
125VTK_ABI_NAMESPACE_END
126#endif
Superclass for all sources, filters, and sinks in VTK.
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 void EventRelay(vtkObject *caller, unsigned long eventId, void *clientData, void *callData)
This is the callback that VTK will invoke when it sees StartEvent and EndEvent.
static vtkExecutionTimer * New()
Construct a new timer with no attached filter.
void SetFilter(vtkAlgorithm *filter)
Set/get the filter to be monitored.
vtkCallbackCommand * Callback
virtual void TimerFinished()
This is where you can do anything you want with the progress event.
vtkAlgorithm * Filter
void StopTimer()
Convenience functions – StartTimer clears out the elapsed times and records start times; StopTimer re...
void StartTimer()
Convenience functions – StartTimer clears out the elapsed times and records start times; StopTimer re...
a simple class to control print indentation
Definition vtkIndent.h:108
abstract base class for most VTK objects
Definition vtkObject.h:162
#define VTK_MARSHALAUTO