class Timer in group4. More...
#include <Timer.h>
Public Member Functions | |
Timer () | |
~Timer () | |
void | Start () |
void | Stop () |
double | GetWallTime () |
double | GetProcessorTime () |
double | GetUserProcessorTime () |
double | GetSystemProcessorTime () |
Private Attributes | |
struct tms | tms_BeginTimer |
UNIX only. Used to measure longer execution time. | |
struct tms | tms_EndTimer |
clock_t | ct_BeginTimer |
clock_t | ct_EndTimer |
The timer class is the only class in ColPack which has an optional dependency on the operating system. It offers both system independent C++ timer based on ctime.h or linux/unix dependent timer based on sys/times.h. The sytem independent timer only gives wall clock time while linux/unix dependent timer gives wall, processor, user and system times.
Definition at line 52 of file Timer.h.
double ColPack::Timer::GetProcessorTime | ( | ) |
Definition at line 90 of file Timer.cpp.
References _UNKNOWN, tms_BeginTimer, and tms_EndTimer.
double ColPack::Timer::GetSystemProcessorTime | ( | ) |
Definition at line 127 of file Timer.cpp.
References _UNKNOWN, tms_BeginTimer, and tms_EndTimer.
double ColPack::Timer::GetUserProcessorTime | ( | ) |
Definition at line 109 of file Timer.cpp.
References _UNKNOWN, tms_BeginTimer, and tms_EndTimer.
double ColPack::Timer::GetWallTime | ( | ) |
Definition at line 74 of file Timer.cpp.
References ct_BeginTimer, and ct_EndTimer.
Referenced by ColPack::GraphColoringInterface::AcyclicColoring(), ColPack::GraphColoringInterface::AcyclicColoring_ForIndirectRecovery(), ColPack::BipartiteGraphBicoloringInterface::Bicoloring(), ColPack::GraphColoringInterface::DistanceOneColoring(), ColPack::GraphColoringInterface::DistanceTwoColoring(), ColPack::BipartiteGraphBicoloring::ExplicitCoveringModifiedStarBicoloring(), ColPack::BipartiteGraphBicoloring::ExplicitCoveringStarBicoloring(), ColPack::BipartiteGraphBicoloring::MinimalCoveringColumnMajorStarBicoloring(), ColPack::BipartiteGraphBicoloring::MinimalCoveringRowMajorStarBicoloring(), ColPack::BipartiteGraphBicoloring::MinimalCoveringStarBicoloring(), ColPack::GraphColoringInterface::NaiveStarColoring(), ColPack::BipartiteGraphPartialColoringInterface::PartialDistanceTwoColoring(), ColPack::GraphColoringInterface::RestrictedStarColoring(), ColPack::GraphColoringInterface::StarColoring(), toFileC_forColoringBasedOrdering(), and ColPack::GraphColoringInterface::TriangularColoring().
void ColPack::Timer::Start | ( | ) |
Definition at line 42 of file Timer.cpp.
References ct_BeginTimer, and tms_BeginTimer.
Referenced by ColPack::GraphColoringInterface::AcyclicColoring(), ColPack::GraphColoringInterface::AcyclicColoring_ForIndirectRecovery(), ColPack::BipartiteGraphBicoloringInterface::Bicoloring(), ColPack::GraphColoringInterface::DistanceOneColoring(), ColPack::GraphColoringInterface::DistanceTwoColoring(), ColPack::BipartiteGraphBicoloring::ExplicitCoveringModifiedStarBicoloring(), ColPack::BipartiteGraphBicoloring::ExplicitCoveringStarBicoloring(), ColPack::BipartiteGraphBicoloring::MinimalCoveringColumnMajorStarBicoloring(), ColPack::BipartiteGraphBicoloring::MinimalCoveringRowMajorStarBicoloring(), ColPack::BipartiteGraphBicoloring::MinimalCoveringStarBicoloring(), ColPack::GraphColoringInterface::NaiveStarColoring(), ColPack::BipartiteGraphPartialColoringInterface::PartialDistanceTwoColoring(), ColPack::GraphColoringInterface::RestrictedStarColoring(), ColPack::GraphColoringInterface::StarColoring(), toFileC_forColoringBasedOrdering(), and ColPack::GraphColoringInterface::TriangularColoring().
void ColPack::Timer::Stop | ( | ) |
Definition at line 58 of file Timer.cpp.
References ct_EndTimer, and tms_EndTimer.
Referenced by ColPack::GraphColoringInterface::AcyclicColoring(), ColPack::GraphColoringInterface::AcyclicColoring_ForIndirectRecovery(), ColPack::BipartiteGraphBicoloringInterface::Bicoloring(), ColPack::GraphColoringInterface::DistanceOneColoring(), ColPack::GraphColoringInterface::DistanceTwoColoring(), ColPack::BipartiteGraphBicoloring::ExplicitCoveringModifiedStarBicoloring(), ColPack::BipartiteGraphBicoloring::ExplicitCoveringStarBicoloring(), ColPack::BipartiteGraphBicoloring::MinimalCoveringColumnMajorStarBicoloring(), ColPack::BipartiteGraphBicoloring::MinimalCoveringRowMajorStarBicoloring(), ColPack::BipartiteGraphBicoloring::MinimalCoveringStarBicoloring(), ColPack::GraphColoringInterface::NaiveStarColoring(), ColPack::BipartiteGraphPartialColoringInterface::PartialDistanceTwoColoring(), ColPack::GraphColoringInterface::RestrictedStarColoring(), ColPack::GraphColoringInterface::StarColoring(), toFileC_forColoringBasedOrdering(), and ColPack::GraphColoringInterface::TriangularColoring().
clock_t ColPack::Timer::ct_BeginTimer [private] |
Definition at line 69 of file Timer.h.
Referenced by GetWallTime(), and Start().
clock_t ColPack::Timer::ct_EndTimer [private] |
Definition at line 70 of file Timer.h.
Referenced by GetWallTime(), and Stop().
struct tms ColPack::Timer::tms_BeginTimer [private] |
UNIX only. Used to measure longer execution time.
Define SYSTEM_TIME to measure the execution time of a program which may run for more than 30 minutes (35.79 minutes or 2,147 seconds to be accurate) Reason: In UNIX, CLOCKS_PER_SEC is defined to be 1,000,000 (In Windows, CLOCKS_PER_SEC == 1,000). The # of clock-ticks is measured by using variables of type int => max value is 2,147,483,648. Time in seconds = # of clock-ticks / CLOCKS_PER_SEC => max Time in seconds = 2,147,483,648 / 1,000,000 ~= 2,147
Definition at line 65 of file Timer.h.
Referenced by GetProcessorTime(), GetSystemProcessorTime(), GetUserProcessorTime(), and Start().
struct tms ColPack::Timer::tms_EndTimer [private] |
Definition at line 66 of file Timer.h.
Referenced by GetProcessorTime(), GetSystemProcessorTime(), GetUserProcessorTime(), and Stop().