• Home
  • Raw
  • Download

Lines Matching refs:other

67   TimeDifference operator+(const TimeDifference& other) const {
69 ret.tv_nsec = (ts_.tv_nsec + other.ts_.tv_nsec) % 1000000000;
70 ret.tv_sec = (ts_.tv_sec + other.ts_.tv_sec) +
71 (ts_.tv_nsec + other.ts_.tv_nsec) / 1000000000;
72 return TimeDifference(ret, scale_ < other.scale_ ? scale_: other.scale_);
75 TimeDifference operator-(const TimeDifference& other) const {
79 ret.tv_nsec = (1000000000 + ts_.tv_nsec - other.ts_.tv_nsec) % 1000000000;
80 ret.tv_sec = (ts_.tv_sec - other.ts_.tv_sec) -
81 (ts_.tv_nsec < other.ts_.tv_nsec ? 1 : 0);
82 return TimeDifference(ret, scale_ < other.scale_ ? scale_: other.scale_);
85 bool operator<(const TimeDifference& other) const {
86 return ts_.tv_sec < other.ts_.tv_sec ||
87 (ts_.tv_sec == other.ts_.tv_sec && ts_.tv_nsec < other.ts_.tv_nsec);
152 TimeDifference operator-(const MonotonicTimePoint& other) const {
154 rval.tv_sec = ts_.tv_sec - other.ts_.tv_sec;
155 rval.tv_nsec = ts_.tv_nsec - other.ts_.tv_nsec;
163 MonotonicTimePoint operator+(const TimeDifference& other) const {
165 rval.ts_.tv_sec += other.seconds();
166 rval.ts_.tv_nsec += other.subseconds_in_ns();
174 bool operator==(const MonotonicTimePoint& other) const {
175 return (ts_.tv_sec == other.ts_.tv_sec) &&
176 (ts_.tv_nsec == other.ts_.tv_nsec);
179 bool operator!=(const MonotonicTimePoint& other) const {
180 return !(*this == other);
183 bool operator<(const MonotonicTimePoint& other) const {
184 return ((ts_.tv_sec - other.ts_.tv_sec) < 0) ||
185 ((ts_.tv_sec == other.ts_.tv_sec) &&
186 (ts_.tv_nsec < other.ts_.tv_nsec));
189 bool operator>(const MonotonicTimePoint& other) const {
190 return other < *this;
193 bool operator<=(const MonotonicTimePoint& other) const {
194 return !(*this > other);
197 bool operator>=(const MonotonicTimePoint& other) const {
198 return !(*this < other);
201 MonotonicTimePoint& operator+=(const TimeDifference& other) {
202 ts_.tv_sec += other.seconds();
203 ts_.tv_nsec += other.subseconds_in_ns();
211 MonotonicTimePoint& operator-=(const TimeDifference& other) {
212 ts_.tv_sec -= other.seconds();
213 ts_.tv_nsec -= other.subseconds_in_ns();