|
Open Graph Drawing Framework |
v. 2023.09 (Elderberry)
|
|
|
Go to the documentation of this file.
56 Stopwatch() : m_startTime(0), m_totalTime(0), m_running(false) { }
66 : m_startTime(0), m_totalTime(milliSecs), m_running(false) { }
76 void start(
bool reset =
false);
91 bool running()
const {
return m_running; }
98 return m_running ? m_totalTime + theTime() - m_startTime : m_totalTime;
112 int64_t
seconds()
const {
return milliSeconds() / 1000; }
119 int64_t
minutes()
const {
return seconds() / 60; }
126 int64_t
hours()
const {
return seconds() / 3600; }
129 bool exceeds(int64_t maxSeconds)
const {
return seconds() >= maxSeconds; }
153 virtual int64_t theTime()
const = 0;
179 virtual int64_t theTime()
const override;
205 virtual int64_t theTime()
const override;
int64_t milliSeconds() const
Returns the currently elapsed time in milliseconds.
The namespace for all OGDF objects.
Implements a stopwatch measuring wall-clock time.
StopwatchWallClock()
Creates a stopwatch for measuring wall-clock time with total time 0.
int64_t m_startTime
The start time of the timer in milliseconds.
Implements a stopwatch measuring CPU time.
int64_t hours() const
Returns the currently elapsed time in hours.
StopwatchCPU()
Creates a stopwatch for measuring CPU time with total time 0.
void addCentiSeconds(int64_t centiSeconds)
Adds centiSeconds to total time.
Stopwatch(int64_t milliSecs)
Initializes a stopwatch and sets its total time to milliSecs.
int64_t seconds() const
Returns the currently elapsed time in seconds.
Stopwatch()
Initializes a stop watch with total time 0.
int64_t m_totalTime
The total time in milliseconds.
StopwatchWallClock(int64_t milliSecs)
Creates a stopwatch for measuring wall-clock time and sets its total time to milliSecs.
std::ostream & operator<<(std::ostream &os, const ogdf::Array< E, INDEX > &a)
Prints array a to output stream os.
int64_t minutes() const
Returns the currently elapsed time in minutes.
int64_t centiSeconds() const
Returns the currently elapsed time in 1/100-seconds.
bool running() const
Returns true if the stopwatch is running, false otherwise.
bool m_running
true, if the timer is running.
Basic declarations, included by all source files.
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Realizes a stopwatch for measuring elapsed time.
StopwatchCPU(int64_t milliSecs)
Creates a stopwatch for measuring CPU time and sets its total time to milliSecs.
virtual ~StopwatchWallClock()
void reset()
Stops the stopwatch and sets its total time to 0.
bool exceeds(int64_t maxSeconds) const
Returns true iff the currently elapsed time exceeds maxSeconds.