Go to the documentation of this file.
37 #include "vtkCommonSystemModule.h"
44 #include <sys/types.h>
45 #include <sys/timeb.h>
49 #include <sys/types.h>
50 #include <sys/times.h>
60 # define SELECT_MASK fd_set
66 # define SELECT_MASK void
68 # define SELECT_MASK int
112 static void SetMaxEntries(
int a);
113 static int GetMaxEntries();
120 static void FormatAndMarkEvent(
const char *EventString, ...);
127 static void DumpLog(
const char *filename);
136 static void MarkStartEvent(
const char *EventString);
137 static void MarkEndEvent(
const char *EventString);
145 static void InsertTimedEvent(
146 const char *EventString,
double time,
int cpuTicks);
149 static void DumpLogWithIndents(ostream *os,
double threshold);
150 static void DumpLogWithIndentsAndPercentages(ostream *os);
156 static int GetNumberOfEvents();
157 static int GetEventIndent(
int i);
158 static double GetEventWallTime(
int i);
159 static const char* GetEventString(
int i);
166 static void MarkEvent(
const char *EventString);
172 static void ResetLog();
179 static void AllocateLog();
185 static void CleanupLog();
191 static double GetUniversalTime();
197 static double GetCPUTime();
213 double GetElapsedTime();
229 static timeb FirstWallTime;
230 static timeb CurrentWallTime;
232 static FILETIME FirstWallTime;
233 static FILETIME CurrentWallTime;
245 static void MarkEventInternal(
256 static void DumpEntry(ostream& os,
int index,
double time,
double deltatime,
257 int tick,
int deltatick,
const char *event);
294 #define vtkTimerLogMacro(string) \
296 vtkTimerLog::FormatAndMarkEvent("Mark: In %s, line %d, class %s: %s", \
297 __FILE__, __LINE__, this->GetClassName(), string); \
static std::vector< vtkTimerLogEntry > TimerLog
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
abstract base class for most VTK objects
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.
a simple class to control print indentation
vtkTimerLogScope(const char *eventString)
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static timeval CurrentWallTime
Helper class to log time within scope.
static void SetLogging(int v)
This flag will turn logging of events off or on.
Timer support and logging.
static int TicksPerSecond
static timeval FirstWallTime
static void MarkEndEvent(const char *EventString)
static tms CurrentCpuTicks