25 #include "vtkCommonSystemModule.h"
32 #include <sys/timeb.h>
33 #include <sys/types.h>
36 #include <sys/times.h>
37 #include <sys/types.h>
48 #define SELECT_MASK fd_set
54 #define SELECT_MASK void
56 #define SELECT_MASK int
60 VTK_ABI_NAMESPACE_BEGIN
106 static void SetMaxEntries(
int a);
107 static int GetMaxEntries();
116 template <
typename... T>
124 static char event[4096];
126 vtk::runtime(format), std::forward<T>(args)...);
127 *result.out =
'\0', );
146 static void MarkStartEvent(
const char* EventString);
147 static void MarkEndEvent(
const char* EventString);
155 static void InsertTimedEvent(
const char* EventString,
double time,
int cpuTicks);
158 static void DumpLogWithIndents(ostream* os,
double threshold);
159 static void DumpLogWithIndentsAndPercentages(ostream* os);
165 static int GetNumberOfEvents();
166 static int GetEventIndent(
int i);
167 static double GetEventWallTime(
int i);
168 static const char* GetEventString(
int i);
175 static void MarkEvent(
const char* EventString);
181 static void ResetLog();
186 static void CleanupLog();
192 static double GetUniversalTime();
198 static double GetCPUTime();
214 double GetElapsedTime();
233 static timeb FirstWallTime;
234 static timeb CurrentWallTime;
236 static FILETIME FirstWallTime;
237 static FILETIME CurrentWallTime;
259 static void DumpEntry(ostream& os,
int index,
double time,
double deltatime,
int tick,
260 int deltatick,
const char* event);
295 #define vtkTimerLogMacro(string) \
297 vtkTimerLog::FormatAndMarkEvent("Mark: In {:s}, line {:s}, class {:s}: {:s}", __FILE__, \
298 __LINE__, this->GetClassName(), string); \
314 VTK_ABI_NAMESPACE_END
VTKCOMMONCORE_EXPORT std::string to_std_format(const std::string &format)
Convert printf and std::format style format strings.
abstract base class for most VTK objects
static void FormatAndMarkEvent(const char *formatArg, T &&...args)
Record a timing event.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static vtkTimerLogCleanup vtkTimerLogCleanupInstance
static void MarkEventInternal(const char *EventString, vtkTimerLogEntry::LogEntryType type, vtkTimerLogEntry *entry=nullptr)
Record a timing event and capture wall time and cpu ticks.
Helper class to log time within scope.
static void MarkStartEvent(const char *EventString)
I want to time events, so I am creating this interface to mark events that have a start and an end...
Timer support and logging.
a simple class to control print indentation
static timeval CurrentWallTime
vtkTimerLogScope(const char *eventString)
static void SetLogging(int v)
This flag will turn logging of events off or on.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
static int TicksPerSecond
static timeval FirstWallTime
static tms CurrentCpuTicks
static void MarkEndEvent(const char *EventString)
I want to time events, so I am creating this interface to mark events that have a start and an end...