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
225 static timeb FirstWallTime;
226 static timeb CurrentWallTime;
228 static FILETIME FirstWallTime;
229 static FILETIME CurrentWallTime;
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); \
a simple class to control print indentation
abstract base class for most VTK objects
Helper class to log time within scope.
vtkTimerLogScope(const char *eventString)
Timer support and logging.
static double GetUniversalTime()
Returns the elapsed number of seconds since 00:00:00 Coordinated Universal Time (UTC),...
static void static void DumpLog(const char *filename)
Write the timing table out to a file.
static tms CurrentCpuTicks
static vtkTimerLogEntry::LogEntryType GetEventType(int i)
static void InsertTimedEvent(const char *EventString, double time, int cpuTicks)
Insert an event with a known wall time value (in seconds) and cpuTicks.
static std::vector< vtkTimerLogEntry > TimerLog
static timeval CurrentWallTime
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static double GetEventWallTime(int i)
static int GetNumberOfEvents()
Programmatic access to events.
static int TicksPerSecond
static const char * GetEventString(int i)
static void CleanupLog()
Remove timer log.
static void MarkEndEvent(const char *EventString)
static vtkTimerLogEntry * GetEvent(int i)
static void SetMaxEntries(int a)
Set/Get the maximum number of entries allowed in the timer log.
static void FormatAndMarkEvent(const char *EventString,...) VTK_FORMAT_PRINTF(1
Record a timing event.
static void ResetLog()
Clear the timing table.
static void DumpLogWithIndentsAndPercentages(ostream *os)
void StopTimer()
Sets EndTime to the current time.
static void SetLogging(int v)
This flag will turn logging of events off or on.
static timeval FirstWallTime
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 MarkEvent(const char *EventString)
Record a timing event and capture wall time and cpu ticks.
static void MarkEventInternal(const char *EventString, vtkTimerLogEntry::LogEntryType type, vtkTimerLogEntry *entry=nullptr)
Record a timing event and capture wall time and cpu ticks.
static int GetMaxEntries()
double GetElapsedTime()
Returns the difference between StartTime and EndTime as a doubleing point value indicating the elapse...
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 vtkTimerLog * New()
void StartTimer()
Set the StartTime to the current time.
static void DumpEntry(ostream &os, int index, double time, double deltatime, int tick, int deltatick, const char *event)