#include <OpenMS/SYSTEM/StopWatch.h>
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 | |
double | getClockTime () const |
double | getUserTime () const |
double | getSystemTime () const |
double | getCPUTime () const |
Assignment | |
StopWatch & | operator= (const StopWatch &stop_watch) |
Predicates | |
bool | isRunning () const |
bool | operator== (const StopWatch &stop_watch) const |
bool | operator!= (const StopWatch &stop_watch) const |
bool | operator< (const StopWatch &stop_watch) const |
bool | operator<= (const StopWatch &stop_watch) const |
bool | operator>= (const StopWatch &stop_watch) const |
bool | operator> (const StopWatch &stop_watch) const |
Static Public Member Functions | |
static String | toString (double time) |
Private Types | |
typedef clock_t | TimeType |
Static Private Attributes | |
static PointerSizeInt | cpu_speed_ |
StopWatch Class.
This class is used to determine the current process time.
|
private |
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 |
Destructor. Destructs a stop watch object.
void clear | ( | ) |
Starting, Stopping and Resetting the stop watchClear and stop the stop watch. This sets the stop watch to zero and stops it when running.
double getClockTime | ( | ) | const |
Get clock time. Return the accumulated clock (real) time in seconds.
Referenced by main().
|
inline |
Get CPU time. Return the accumulated CPU time in seconds. CPU time is the sum of user time and system time.
Referenced by StopWatch::operator<().
double getSystemTime | ( | ) | const |
Get user time. Return the accumulated system time in seconds.
double getUserTime | ( | ) | const |
Get user time. Return the accumulated user time in seconds.
|
inline |
Return true if the stop watch is running.
Inequality operator. Return false if two stop watches 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 |
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 |
References StopWatch::getCPUTime().
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 |
Assignment operator. Assigns a stop watch from another. The two stop watch will then run synchronously.
*this
Equality operator. Return true if two stop watches 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 |
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 |
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 |
void reset | ( | ) |
Clear the stop watch without stopping. The stop watch is cleared, but not stopped (if running).
bool start | ( | ) |
Start the stop watch. The stop watch is started. If the stop watch is already running, false is returned.
Referenced by main().
bool stop | ( | ) |
Stop the stop watch. The stop watch is stopped. If the stop watch was not running, false is returned.
Referenced by main().
custom string formatting of time, using only the minimal number of units required (e.g., does not report hours when seconds suffice).
|
staticprivate |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
OpenMS / TOPP release 2.0.0 | Documentation generated on Sat May 16 2015 16:14:07 using doxygen 1.8.9.1 |