25 #include "vtkCommonSystemModule.h"
31 #include <sys/timeb.h>
32 #include <sys/types.h>
35 #include <sys/times.h>
36 #include <sys/types.h>
47 #define SELECT_MASK fd_set
53 #define SELECT_MASK void
55 #define SELECT_MASK int
59 VTK_ABI_NAMESPACE_BEGIN
105 static void SetMaxEntries(
int a);
106 static int GetMaxEntries();
114 static void FormatAndMarkEvent(
const char* format, ...) VTK_FORMAT_PRINTF(1, 2);
131 static void MarkStartEvent(
const char* EventString);
132 static void MarkEndEvent(
const char* EventString);
140 static void InsertTimedEvent(
const char* EventString,
double time,
int cpuTicks);
143 static void DumpLogWithIndents(ostream* os,
double threshold);
144 static void DumpLogWithIndentsAndPercentages(ostream* os);
150 static int GetNumberOfEvents();
151 static int GetEventIndent(
int i);
152 static double GetEventWallTime(
int i);
153 static const char* GetEventString(
int i);
160 static void MarkEvent(
const char* EventString);
166 static void ResetLog();
171 static void CleanupLog();
177 static double GetUniversalTime();
183 static double GetCPUTime();
199 double GetElapsedTime();
218 static timeb FirstWallTime;
219 static timeb CurrentWallTime;
221 static FILETIME FirstWallTime;
222 static FILETIME CurrentWallTime;
244 static void DumpEntry(ostream& os,
int index,
double time,
double deltatime,
int tick,
245 int deltatick,
const char* event);
280 #define vtkTimerLogMacro(string) \
282 vtkTimerLog::FormatAndMarkEvent( \
283 "Mark: In %s, line %d, class %s: %s", __FILE__, __LINE__, this->GetClassName(), string); \
299 VTK_ABI_NAMESPACE_END
abstract base class for most VTK objects
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static vtkTimerLogCleanup vtkTimerLogCleanupInstance
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...