55 Stopwatch() : m_startTime(0), m_totalTime(0), m_running(false) { }
64 explicit Stopwatch(int64_t milliSecs) : m_startTime(0), m_totalTime(milliSecs), m_running(false) { }
76 void start(
bool reset =
false);
92 bool running()
const {
return m_running; }
100 return (m_running) ? (m_totalTime + theTime() - m_startTime) : m_totalTime;
114 int64_t
seconds()
const {
return milliSeconds()/1000; }
121 int64_t
minutes()
const {
return seconds()/60; }
128 int64_t
hours()
const {
return seconds()/3600; }
133 return seconds() >= maxSeconds;
141 m_totalTime += 10*centiSeconds;
162 virtual int64_t theTime()
const = 0;
190 virtual int64_t theTime()
const override;
217 virtual int64_t theTime()
const override;
StopwatchWallClock(int64_t milliSecs)
Creates a stopwatch for measuring wall-clock time and sets its total time to milliSecs.
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
bool m_running
true, if the timer is running.
int64_t minutes() const
Returns the currently elapsed time in minutes.
StopwatchWallClock()
Creates a stopwatch for measuring wall-clock time with total time 0.
StopwatchCPU(int64_t milliSecs)
Creates a stopwatch for measuring CPU time and sets its total time to milliSecs.
int64_t centiSeconds() const
Returns the currently elapsed time in 1/100-seconds.
virtual ~StopwatchWallClock()
ostream & operator<<(ostream &os, const ogdf::Array< E, INDEX > &a)
Prints array a to output stream os.
bool exceeds(int64_t maxSeconds) const
Returns true iff the currently elapsed time exceeds maxSeconds.
Stopwatch(int64_t milliSecs)
Initializes a stopwatch and sets its total time to milliSecs.
int64_t m_totalTime
The total time in milliseconds.
Stopwatch()
Initializes a stop watch with total time 0.
Implements a stopwatch measuring wall-clock time.
StopwatchCPU()
Creates a stopwatch for measuring CPU time with total time 0.
int64_t milliSeconds() const
Returns the currently elapsed time in milliseconds.
bool running() const
Returns true if the stopwatch is running, false otherwise.
Basic declarations, included by all source files.
void addCentiSeconds(int64_t centiSeconds)
Adds centiSeconds to total time.
int64_t seconds() const
Returns the currently elapsed time in seconds.
int64_t hours() const
Returns the currently elapsed time in hours.
The namespace for all OGDF objects.
void reset()
Stops the stopwatch and sets its total time to 0.
int64_t m_startTime
The start time of the timer in milliseconds.
Realizes a stopwatch for measuring elapsed time.
Implements a stopwatch measuring CPU time.