add RageTimer::operator+=

cleanup
This commit is contained in:
Glenn Maynard
2005-01-26 20:53:21 +00:00
parent fde9e0cfc9
commit 4757f00aba
+5 -4
View File
@@ -47,10 +47,11 @@ public:
RageTimer Half() const; RageTimer Half() const;
/* Add (or subtract) a duration from a timestamp. The result is another timestamp. */ /* Add (or subtract) a duration from a timestamp. The result is another timestamp. */
RageTimer operator+(float tm) const; RageTimer operator+( float tm ) const;
void operator+=( float tm ) { *this = *this + tm; }
/* Find the amount of time between two timestamps. The result is a duration. */ /* Find the amount of time between two timestamps. The result is a duration. */
float operator-(const RageTimer &rhs) const; float operator-( const RageTimer &rhs ) const;
/* "float" is bad for a "time since start" RageTimer. If the game is running for /* "float" is bad for a "time since start" RageTimer. If the game is running for
* several days, we'll lose a lot of resolution. I don't want to use double * several days, we'll lose a lot of resolution. I don't want to use double
@@ -59,8 +60,8 @@ public:
unsigned m_secs, m_us; unsigned m_secs, m_us;
private: private:
static RageTimer Sum(const RageTimer &lhs, float tm); static RageTimer Sum( const RageTimer &lhs, float tm );
static float Difference(const RageTimer &lhs, const RageTimer &rhs); static float Difference( const RageTimer &lhs, const RageTimer &rhs );
}; };
extern const RageTimer RageZeroTimer; extern const RageTimer RageZeroTimer;