#include <BALL/SYSTEM/timer.h>
Timer Class
Definition at line 30 of file timer.h.
◆ Timer() [1/2]
Default constructor. Create a new timer. The timer is stopped.
◆ Timer() [2/2]
BALL::Timer::Timer |
( |
Timer & |
timer | ) |
|
Copy constructor. Create a new timer from an existing timer.
◆ ~Timer()
virtual BALL::Timer::~Timer |
( |
| ) |
|
|
virtual |
Destructor. Destructs a timer object.
◆ clear()
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.
- See also
- reset
◆ dump()
void BALL::Timer::dump |
( |
::std::ostream & |
s = ::std::cout , |
|
|
Size |
depth = 0L |
|
) |
| const |
Dump the timer's contents.
◆ getClockTime()
double BALL::Timer::getClockTime |
( |
| ) |
const |
Get clock time. Return the accumulated clock (real) time in seconds.
◆ getCPUTime()
Get CPU time. Return the accumulated CPU time in seconds. CPU time is the sum of user time and system time.
Definition at line 20 of file timer.h.
◆ getSystemTime()
double BALL::Timer::getSystemTime |
( |
| ) |
const |
Get user time. Return the accumulated system time in seconds.
◆ getUserTime()
double BALL::Timer::getUserTime |
( |
| ) |
const |
Get user time. Return the accumulated user time in seconds.
◆ isRunning()
Return true if the timer is running.
- Returns
- bool true if the timer is running, false otherwise
Definition at line 14 of file timer.h.
◆ isValid()
Test if the instance is valid. Allways returns true.
Definition at line 8 of file timer.h.
◆ operator!=()
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.
- Parameters
-
timer | the timer to compare with |
- Returns
- bool true on inequality, false otherwise
Definition at line 26 of file timer.h.
◆ operator<()
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).
- Parameters
-
timer | the timer to compare with |
- Returns
- bool true if all times are lesser
Definition at line 32 of file timer.h.
◆ operator<=()
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).
- Parameters
-
timer | the timer to compare with |
- Returns
- bool true if all times are lesser or equal
Definition at line 44 of file timer.h.
◆ operator=()
Timer& BALL::Timer::operator= |
( |
const Timer & |
timer | ) |
|
Assignment operator. Assigns a timer from another. The two timer will then run synchronously.
- Returns
- Timer
*this
◆ operator==()
bool BALL::Timer::operator== |
( |
const Timer & |
timer | ) |
const |
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.
- Parameters
-
timer | the timer to compare with |
- Returns
- bool true on equality, false otherwise
◆ operator>()
Greater operator. Return true, if the timer is in all timings greater than the timer to be compared with (clock, user and system time).
- Parameters
-
timer | the timer to compare with |
- Returns
- bool true if all times are greater
Definition at line 38 of file timer.h.
◆ operator>=()
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).
- Parameters
-
timer | the timer to compare with |
- Returns
- bool true if all times are greater or equal
Definition at line 50 of file timer.h.
◆ reset()
void BALL::Timer::reset |
( |
| ) |
|
Clear the timer without stopping. The timer is cleared, but not stopped (if running).
- See also
- clear
◆ start()
bool BALL::Timer::start |
( |
| ) |
|
Start the timer. The timer is started. If the timer is already running, false is returned.
- Returns
- bool false if the timer was already running, true otherwise
◆ stop()
bool BALL::Timer::stop |
( |
| ) |
|
Stop the timer. The timer is stopped. If the timer was not running, false is returned.
- Returns
- bool false if the was not running, true otherwise