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
146 const char *EventString,
double time,
int cpuTicks);
229 static timeb FirstWallTime;
230 static timeb CurrentWallTime;
232 static FILETIME FirstWallTime;
233 static FILETIME CurrentWallTime;
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 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.
static std::vector< vtkTimerLogEntry > TimerLog
void StopTimer()
Sets EndTime to the current time.
static void InsertTimedEvent(const char *EventString, double time, int cpuTicks)
Insert an event with a known wall time value (in seconds) and cpuTicks.
static void MarkEventInternal(const char *EventString, vtkTimerLogEntry::LogEntryType type, vtkTimerLogEntry *entry=nullptr)
Record a timing event and capture wall time and cpu ticks.
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 vtkTimerLogEntry::LogEntryType GetEventType(int i)
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
vtkTimerLogScope(const char *eventString)
static void CleanupLog()
Remove timer log.
static const char * GetEventString(int i)
static timeval CurrentWallTime
Helper class to log time within scope.
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 logging 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()
Programmatic access to events.
static void SetMaxEntries(int a)
Set/Get the maximum number of entries allowed in the timer log.
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.