#include <OpenMS/SYSTEM/StopWatch.h>
This class is used to determine the current process time.
Public Member Functions | |
Constructors and Destructors | |
StopWatch () | |
StopWatch (const StopWatch &stop_watch) | |
virtual | ~StopWatch () |
void | clear () |
bool | start () |
bool | stop () |
void | reset () |
Readout of the StopWatch | |
DoubleReal | getClockTime () const |
DoubleReal | getUserTime () const |
DoubleReal | getSystemTime () const |
DoubleReal | getCPUTime () const throw () |
Assignment | |
StopWatch & | operator= (const StopWatch &stop_watch) |
Predicates | |
bool | isRunning () const throw () |
bool | operator== (const StopWatch &stop_watch) const |
bool | operator!= (const StopWatch &stop_watch) const throw () |
bool | operator< (const StopWatch &stop_watch) const throw () |
bool | operator<= (const StopWatch &stop_watch) const throw () |
bool | operator>= (const StopWatch &stop_watch) const throw () |
bool | operator> (const StopWatch &stop_watch) const throw () |
Private Attributes | |
bool | is_running_ |
PointerSizeInt | last_secs_ |
PointerSizeInt | last_usecs_ |
clock_t | last_user_time_ |
clock_t | last_system_time_ |
PointerSizeInt | current_secs_ |
PointerSizeInt | current_usecs_ |
clock_t | current_user_time_ |
clock_t | current_system_time_ |
Static Private Attributes | |
static PointerSizeInt | cpu_speed_ |
StopWatch | ( | ) |
Default constructor. Create a new stop watch. The stop watch is stopped.
Copy constructor. Create a new stop watch from an existing stop watch.
virtual ~StopWatch | ( | ) | [virtual] |
Destructor. Destructs a stop watch object.
void clear | ( | ) |
Starting, Stopping and Resetting the stop watch Clear and stop the stop watch. This sets the stop watch to zero and stops it when running.
bool start | ( | ) |
Start the stop watch. The stop watch is started. If the stop watch is already running, false is returned.
bool stop | ( | ) |
Stop the stop watch. The stop watch is stopped. If the stop watch was not running, false is returned.
void reset | ( | ) |
Clear the stop watch without stopping. The stop watch is cleared, but not stopped (if running).
DoubleReal getClockTime | ( | ) | const |
Get clock time. Return the accumulated clock (real) time in seconds.
DoubleReal getUserTime | ( | ) | const |
Get user time. Return the accumulated user time in seconds.
DoubleReal getSystemTime | ( | ) | const |
Get user time. Return the accumulated system time in seconds.
DoubleReal getCPUTime | ( | ) | const throw () [inline] |
Get CPU time. Return the accumulated CPU time in seconds. CPU time is the sum of user time and system time.
Assignment operator. Assigns a stop watch from another. The two stop watch will then run synchronously.
*this
bool isRunning | ( | ) | const throw () [inline] |
Return true if the stop watch is running.
bool operator== | ( | const StopWatch & | stop_watch | ) | const |
Equality operator. Return true if two stop watchs are equal, i.e. they contain exactly the same time intervals for clock, user and system time and have the same running status.
stop_watch | the stop watch to compare with |
bool operator!= | ( | const StopWatch & | stop_watch | ) | const throw () [inline] |
Inequality operator. Return false if two stop watchs differ in any way, i.e. they differ in either the clock, user, or system time or have a different running status.
stop_watch | the stop watch to compare with |
bool operator< | ( | const StopWatch & | stop_watch | ) | const throw () [inline] |
Lesser than operator. Return true, if the stop watch is in all timings lesser than the stop watch to be compared with (clock, user and system time).
stop_watch | the stop watch to compare with |
bool operator<= | ( | const StopWatch & | stop_watch | ) | const throw () [inline] |
Lesser or equal operator. Return true, if the stop watch is in all timings lesser or equal than the stop watch to be compared with (clock, user and system time).
stop_watch | the stop watch to compare with |
bool operator>= | ( | const StopWatch & | stop_watch | ) | const throw () [inline] |
Greater or equal operator. Return true, if the stop watch is in all timings greater or equal than the stop watch to be compared with (clock, user and system time).
stop_watch | the stop watch to compare with |
bool operator> | ( | const StopWatch & | stop_watch | ) | const throw () [inline] |
Greater operator. Return true, if the stop watch is in all timings greater than the stop watch to be compared with (clock, user and system time).
stop_watch | the stop watch to compare with |
PointerSizeInt cpu_speed_ [static, private] |
bool is_running_ [private] |
PointerSizeInt last_secs_ [private] |
PointerSizeInt last_usecs_ [private] |
clock_t last_user_time_ [private] |
clock_t last_system_time_ [private] |
PointerSizeInt current_secs_ [private] |
PointerSizeInt current_usecs_ [private] |
clock_t current_user_time_ [private] |
clock_t current_system_time_ [private] |
Generated Tue Apr 1 15:36:47 2008 -- using doxygen 1.5.4 | OpenMS / TOPP 1.1 |