BALL 1.5.0
|
#include <BALL/SYSTEM/timer.h>
Public Member Functions | |
Constructors and Destructors | |
Timer () | |
Timer (Timer &timer) | |
virtual | ~Timer () |
void | clear () |
bool | start () |
bool | stop () |
void | reset () |
Readout of the Timer | |
double | getClockTime () const |
double | getUserTime () const |
double | getSystemTime () const |
double | getCPUTime () const |
Assignment | |
Timer & | operator= (const Timer &timer) |
Predicates | |
bool | isRunning () const |
bool | operator== (const Timer &timer) const |
bool | operator!= (const Timer &timer) const |
bool | operator< (const Timer &timer) const |
bool | operator<= (const Timer &timer) const |
bool | operator>= (const Timer &timer) const |
bool | operator> (const Timer &timer) const |
Debugging and Diagnostics | |
bool | isValid () const |
void | dump (::std::ostream &s=::std::cout, Size depth=0L) const |
BALL::Timer::Timer | ( | ) |
Default constructor. Create a new timer. The timer is stopped.
BALL::Timer::Timer | ( | Timer & | timer | ) |
Copy constructor. Create a new timer from an existing timer.
|
virtual |
Destructor. Destructs a timer object.
void BALL::Timer::clear | ( | ) |
Starting, Stopping and Resetting the timer Clear and stop the timer. This sets the timer to zero and stops it when running.
void BALL::Timer::dump | ( | ::std::ostream & | s = ::std::cout , |
Size | depth = 0L |
||
) | const |
Dump the timer's contents.
double BALL::Timer::getClockTime | ( | ) | const |
Get clock time. Return the accumulated clock (real) time in seconds.
double BALL::Timer::getCPUTime | ( | ) | const |
Get CPU time. Return the accumulated CPU time in seconds. CPU time is the sum of user time and system time.
double BALL::Timer::getSystemTime | ( | ) | const |
Get user time. Return the accumulated system time in seconds.
double BALL::Timer::getUserTime | ( | ) | const |
Get user time. Return the accumulated user time in seconds.
bool BALL::Timer::isRunning | ( | ) | const |
Return true if the timer is running.
bool BALL::Timer::isValid | ( | ) | const |
Test if the instance is valid. Allways returns true.
Inequality operator. Return false if two timers differ in any way, i.e. they differ in either the clock, user, or system time or have a different running status.
timer | the timer to compare with |
Lesser than operator. Return true, if the timer is in all timings lesser than the timer to be compared with (clock, user and system time).
timer | the timer to compare with |
Lesser or equal operator. Return true, if the timer is in all timings lesser or equal than the timer to be compared with (clock, user and system time).
timer | the timer to compare with |
Assignment operator. Assigns a timer from another. The two timer will then run synchronously.
*this
Equality operator. Return true if two timers are equal, i.e. they contain exactly the same time intervals for clock, user and system time and have the same running status.
timer | the timer to compare with |
Greater operator. Return true, if the timer is in all timings greater than the timer to be compared with (clock, user and system time).
timer | the timer to compare with |
Greater or equal operator. Return true, if the timer is in all timings greater or equal than the timer to be compared with (clock, user and system time).
timer | the timer to compare with |
void BALL::Timer::reset | ( | ) |
Clear the timer without stopping. The timer is cleared, but not stopped (if running).
bool BALL::Timer::start | ( | ) |
Start the timer. The timer is started. If the timer is already running, false is returned.
bool BALL::Timer::stop | ( | ) |
Stop the timer. The timer is stopped. If the timer was not running, false is returned.