49 #ifndef vtkRenderTimerLog_h 50 #define vtkRenderTimerLog_h 53 #include "vtkRenderingCoreModule.h" 63 #define VTK_SCOPED_RENDER_EVENT(eventName, timer) \ 64 VTK_SCOPED_RENDER_EVENT2(eventName, timer, _event) 71 #define VTK_SCOPED_RENDER_EVENT2(eventName, timer, identifier) \ 72 vtkRenderTimerLog::ScopedEventLogger identifier; \ 75 std::ostringstream _eventNameStream; \ 76 _eventNameStream << eventName; \ 77 identifier = timer->StartScopedEvent(_eventNameStream.str()); \ 87 struct VTKRENDERINGCORE_EXPORT
Event 99 {
return this->ElapsedTimeNanoseconds() * 1e-9f; }
101 {
return this->ElapsedTimeNanoseconds() * 1e-6f; }
103 {
return this->EndTime - this->StartTime; }
113 void Print(std::ostream &os,
float threshMs = 0.f,
116 this->Print(os, 0.f, threshMs, indent);
122 void Print(std::ostream &os,
float parentTime,
float threshMs,
127 struct VTKRENDERINGCORE_EXPORT
Frame 135 void Print(std::ostream &os,
float threshMs = 0.f);
230 #endif // vtkRenderTimerLog_h abstract base class for most VTK objects
std::vector< Event > Events
vtkTypeUInt64 EndTime
Times are in nanoseconds.
ScopedEventLogger(vtkRenderTimerLog *log)
virtual void MarkFrame()
Call to mark the start of a new frame, or the end of an old one.
ScopedEventLogger StartScopedEvent(const std::string &name)
Create a RAII scoped event.
static vtkRenderTimerLog * New()
void Print(std::ostream &os, float threshMs=0.f)
Print details of all events in this frame to a stream.
virtual bool IsSupported()
Returns true if stream timings are implemented for the current graphics backend.
float ElapsedTimeMilliseconds() const
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
a simple class to control print indentation
float ElapsedTimeSeconds() const
Convenience methods to compute times.
void Print(std::ostream &os, float threshMs=0.f, vtkIndent indent=vtkIndent())
Print details of the event to a stream.
Container for a frame's events.
vtkTypeUInt64 ElapsedTimeNanoseconds() const
virtual void MarkStartEvent(const std::string &name)
Mark the beginning or end of an event.
virtual void MarkEndEvent()
Mark the beginning or end of an event.
vtkTypeUInt64 StartTime
Times are in nanoseconds.
virtual bool FrameReady()
Returns true if there are any frames ready with complete timing info.
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
RAII struct for logging events.
virtual void ReleaseGraphicsResources()
Releases any resources allocated on the graphics device.
std::string Name
Event name.
~vtkRenderTimerLog() override
virtual Frame PopFirstReadyFrame()
Retrieve the first available frame's timing info.
vtkBooleanMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
Container for a single timed event.
std::vector< Event > Events
Child events that occurred while this event was running.
Asynchronously measures GPU execution times for a series of events.