Go to the documentation of this file.
37 #include "vtkCommonSystemModule.h"
41 #include <sys/types.h>
42 #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
205 static timeb FirstWallTime;
206 static timeb CurrentWallTime;
208 static FILETIME FirstWallTime;
209 static FILETIME CurrentWallTime;
224 int tick,
int deltatick,
const char *event);
228 void operator=(
const vtkTimerLog&) VTK_DELETE_FUNCTION;
235 #define vtkTimerLogMacro(string) \
237 vtkTimerLog::FormatAndMarkEvent("Mark: In %s, line %d, class %s: %s", \
238 __FILE__, __LINE__, this->GetClassName(), string); \
static double GetCPUTime()
Returns the CPU time for this process On Win32 platforms this actually returns wall time.
static int GetEventIndent(int i)
static void FormatAndMarkEvent(const char *EventString,...)
Record a timing event.
#define VTK_LOG_EVENT_LENGTH
void StopTimer()
Sets EndTime to the current time.
abstract base class for most VTK objects
void StartTimer()
Set the StartTime to the current time.
static void DumpLog(const char *filename)
Write the timing table out to a file.
static double GetEventWallTime(int i)
static vtkTimerLog * New()
static void AllocateLog()
Allocate timing table with MaxEntries elements.
static double GetUniversalTime()
Returns the elapsed number of seconds since January 1, 1970.
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.
static void DumpLogWithIndents(ostream *os, double threshold)
static vtkTimerLogEntry * GetEvent(int i)
a simple class to control print indentation
static void CleanupLog()
Remove timer log.
static const char * GetEventString(int i)
static timeval CurrentWallTime
static void DumpLogWithIndentsAndPercentages(ostream *os)
static void MarkEvent(const char *EventString)
Record a timing event and capture wall time and cpu ticks.
static int GetMaxEntries()
static void SetLogging(int v)
This flag will turn loging of events off or on.
Timer support and logging.
static int TicksPerSecond
static timeval FirstWallTime
double GetElapsedTime()
Returns the difference between StartTime and EndTime as a doubleing point value indicating the elapse...
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static void MarkEndEvent(const char *EventString)
static int GetNumberOfEvents()
Programatic access to events.
static void SetMaxEntries(int a)
Set/Get the maximum number of entries allowed in the timer log.
static vtkTimerLogEntry * TimerLog
static tms CurrentCpuTicks
static void DumpEntry(ostream &os, int index, double time, double deltatime, int tick, int deltatick, const char *event)
static void ResetLog()
Clear the timing table.