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:
hellwig
2012-10-02 12:53:33 +00:00
parent 7d49b6f063
commit 02279833aa
2 changed files with 18 additions and 38 deletions

View File

@ -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__