WallclockTimer updated
git-svn-id: https://www4.informatik.uni-erlangen.de/i4svn/danceos/trunk/devel/fail@1708 8c4709b5-6ec9-48aa-a5cd-a96041d1645a
This commit is contained in:
@ -24,7 +24,7 @@ class WallclockTimer {
|
||||
private:
|
||||
|
||||
bool isRunning;
|
||||
struct timeval start,end,current;
|
||||
struct timeval start,end;
|
||||
|
||||
public:
|
||||
WallclockTimer();
|
||||
@ -36,11 +36,11 @@ public:
|
||||
/**
|
||||
* Returns the elapsed time as string. This works while the timer is running, and if it is stopped.
|
||||
*/
|
||||
std::string getRuntimeAsString();
|
||||
std::string getRuntimeAsString() const;
|
||||
/**
|
||||
* Returns the elapsed time as double. This works while the timer is running, and if it is stopped.
|
||||
*/
|
||||
double getRuntimeAsDouble();
|
||||
double getRuntimeAsDouble() const;
|
||||
/**
|
||||
* Stops the timer.
|
||||
*/
|
||||
@ -50,9 +50,13 @@ public:
|
||||
*/
|
||||
void reset();
|
||||
|
||||
operator double() { return getRuntimeAsDouble(); }
|
||||
|
||||
operator int() { return ((int) getRuntimeAsDouble()); }
|
||||
};
|
||||
|
||||
std::ostream& operator<< (std::ostream& os, const WallclockTimer& w);
|
||||
|
||||
} // end-of-namespace: fail
|
||||
|
||||
#endif // __WALLCLOCKTIMER_HPP__
|
||||
|
||||
Reference in New Issue
Block a user