33 #ifndef __vtkTimerLog_h
34 #define __vtkTimerLog_h
40 #include <sys/types.h>
41 #include <sys/timeb.h>
46 #include <sys/types.h>
47 #include <sys/times.h>
57 # define SELECT_MASK fd_set
63 # define SELECT_MASK void
65 # define SELECT_MASK int
70 #define VTK_LOG_EVENT_LENGTH 40
101 static void SetMaxEntries(
int a);
102 static int GetMaxEntries();
109 static void FormatAndMarkEvent(
const char *EventString, ...);
115 static void DumpLog(
const char *filename);
121 static void MarkStartEvent(
const char *EventString);
122 static void MarkEndEvent(
const char *EventString);
124 static void DumpLogWithIndents(ostream *os,
double threshold);
130 static int GetNumberOfEvents();
131 static int GetEventIndent(
int i);
132 static double GetEventWallTime(
int i);
133 static const char* GetEventString(
int i);
137 static void MarkEvent(
const char *EventString);
141 static void ResetLog();
144 static void AllocateLog();
147 static void CleanupLog();
151 static double GetUniversalTime();
155 static double GetCPUTime();
165 double GetElapsedTime();
167 #ifdef VTK_WORKAROUND_WINDOWS_MANGLE
168 # define GetTickCount GetCurrentTime
173 VTK_LEGACY(
static double GetCurrentTime());
175 #ifdef VTK_WORKAROUND_WINDOWS_MANGLE
178 VTK_LEGACY(
static double GetTickCount());
198 static timeb FirstWallTime;
199 static timeb CurrentWallTime;
201 static FILETIME FirstWallTime;
202 static FILETIME CurrentWallTime;
217 static void DumpEntry(ostream& os,
int index,
double time,
double deltatime,
218 int tick,
int deltatick,
const char *event);
230 #define vtkTimerLogMacro(string) \
232 vtkTimerLog::FormatAndMarkEvent("Mark: In %s, line %d, class %s: %s", \
233 __FILE__, __LINE__, this->GetClassName(), string); \
abstract base class for most VTK objects
#define VTK_LOG_EVENT_LENGTH
Timer support and logging.
virtual void PrintSelf(ostream &os, vtkIndent indent)
a simple class to control print indentation
static timeval CurrentWallTime
static void SetLogging(int v)
static int TicksPerSecond
static timeval FirstWallTime
static vtkTimerLogEntry * TimerLog
static tms CurrentCpuTicks