31 #include "vtkCommonSystemModule.h" 38 #include <sys/timeb.h> 39 #include <sys/types.h> 42 #include <sys/times.h> 43 #include <sys/types.h> 54 #define SELECT_MASK fd_set 60 #define SELECT_MASK void 62 #define SELECT_MASK int 111 static void SetMaxEntries(
int a);
112 static int GetMaxEntries();
120 static void FormatAndMarkEvent(
const char* EventString, ...) VTK_FORMAT_PRINTF(1, 2);
128 static void DumpLog(
const char* filename);
137 static void MarkStartEvent(
const char* EventString);
138 static void MarkEndEvent(
const char* EventString);
146 static void InsertTimedEvent(
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();
177 static void CleanupLog();
183 static double GetUniversalTime();
189 static double GetCPUTime();
205 double GetElapsedTime();
225 static timeb FirstWallTime;
226 static timeb CurrentWallTime;
228 static FILETIME FirstWallTime;
229 static FILETIME CurrentWallTime;
251 static void DumpEntry(ostream& os,
int index,
double time,
double deltatime,
int tick,
252 int deltatick,
const char* event);
287 #define vtkTimerLogMacro(string) \ 289 vtkTimerLog::FormatAndMarkEvent( \ 290 "Mark: In %s, line %d, class %s: %s", __FILE__, __LINE__, this->GetClassName(), string); \
abstract base class for most VTK objects
static std::vector< vtkTimerLogEntry > TimerLog
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
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...