added += time operations

This commit is contained in:
Daniel Larimer 2012-09-21 19:31:51 -04:00
parent 8b998caa1b
commit 7f68de063c

View file

@ -10,6 +10,7 @@ namespace fc {
friend microseconds operator + (const microseconds& l, const microseconds& r ) { return microseconds(l._count+r._count); }
bool operator==(const microseconds& c)const { return _count == c._count; }
microseconds& operator+=(const microseconds& c) { _count += c._count; return *this; }
int64_t count()const { return _count; }
private:
friend class time_point;
@ -30,6 +31,7 @@ namespace fc {
bool operator <=( const time_point& t )const { return elapsed._count <=t.elapsed._count; }
bool operator ==( const time_point& t )const { return elapsed._count ==t.elapsed._count; }
bool operator !=( const time_point& t )const { return elapsed._count !=t.elapsed._count; }
time_point& operator += ( const microseconds& m ) { elapsed+=m; return *this; }
friend time_point operator + ( const time_point& t, const microseconds& m ) { return time_point(t.elapsed+m); }
friend microseconds operator - ( const time_point& t, const time_point& m ) { return microseconds(t.elapsed.count() - m.elapsed.count()); }
private: