#include <timer.h>
Public Member Functions | |
Constructors and Destructors | |
| Timer () | |
| Default constructor. | |
| Timer (Timer &timer) | |
| Copy constructor. | |
| virtual | ~Timer () |
| Destructor. | |
| void | clear () |
| Clear and stop the timer. | |
| bool | start () |
| Start the timer. | |
| bool | stop () |
| Stop the timer. | |
| void | reset () |
| Clear the timer without stopping. | |
Readout of the Timer | |
| double | getClockTime () const |
| Get clock time. | |
| double | getUserTime () const |
| Get user time. | |
| double | getSystemTime () const |
| Get user time. | |
| double | getCPUTime () const |
| Get CPU time. | |
Assignment | |
| Timer & | operator= (const Timer &timer) |
| Assignment operator. | |
Predicates | |
| bool | isRunning () const |
| Return true if the timer is running. | |
| bool | operator== (const Timer &timer) const |
| Equality operator. | |
| bool | operator!= (const Timer &timer) const |
| Inequality operator. | |
| bool | operator< (const Timer &timer) const |
| Lesser than operator. | |
| bool | operator<= (const Timer &timer) const |
| Lesser or equal operator. | |
| bool | operator>= (const Timer &timer) const |
| Greater or equal operator. | |
| bool | operator> (const Timer &timer) const |
| Greater operator. | |
Debugging and Diagnostics | |
| bool | isValid () const |
| Test if the instance is valid. | |
| void | dump (::std::ostream &s=::std::cout, Size depth=0L) const |
| Dump the timer's contents. | |
|
|
Default constructor. Create a new timer. The timer is stopped. |
|
|
Copy constructor. Create a new timer from an existing timer. |
|
|
Destructor. Destructs a timer object. |
|
|
Clear and stop the timer. This sets the timer to zero and stops it when running.
|
|
||||||||||||
|
Dump the timer's contents.
|
|
|
Get clock time. Return the accumulated clock (real) time in seconds. |
|
|
Get CPU time. Return the accumulated CPU time in seconds. CPU time is the sum of user time and system time. |
|
|
Get user time. Return the accumulated system time in seconds. |
|
|
Get user time. Return the accumulated user time in seconds. |
|
|
Return true if the timer is running.
|
|
|
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.
|
|
|
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).
|
|
|
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).
|
|
|
Assignment operator. Assigns a timer from another. The two timer will then run synchronously.
|
|
|
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.
|
|
|
Greater operator. Return true, if the timer is in all timings greater than the timer to be compared with (clock, user and system time).
|
|
|
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).
|
|
|
Clear the timer without stopping. The timer is cleared, but not stopped (if running).
|
|
|
Start the timer. The timer is started. If the timer is already running, false is returned.
|
|
|
Stop the timer. The timer is stopped. If the timer was not running, false is returned.
|