Lines Matching defs:TimeDelta

10 // TimeDelta represents a duration of time, internally represented in
50 // TimeDelta ------------------------------------------------------------------
52 class BASE_API TimeDelta {
54 TimeDelta() : delta_(0) {
58 static TimeDelta FromDays(int64 days);
59 static TimeDelta FromHours(int64 hours);
60 static TimeDelta FromMinutes(int64 minutes);
61 static TimeDelta FromSeconds(int64 secs);
62 static TimeDelta FromMilliseconds(int64 ms);
63 static TimeDelta FromMicroseconds(int64 us);
65 // Returns the internal numeric value of the TimeDelta object. Please don't
91 TimeDelta& operator=(TimeDelta other) {
97 TimeDelta operator+(TimeDelta other) const {
98 return TimeDelta(delta_ + other.delta_);
100 TimeDelta operator-(TimeDelta other) const {
101 return TimeDelta(delta_ - other.delta_);
104 TimeDelta& operator+=(TimeDelta other) {
108 TimeDelta& operator-=(TimeDelta other) {
112 TimeDelta operator-() const {
113 return TimeDelta(-delta_);
118 TimeDelta operator*(int64 a) const {
119 return TimeDelta(delta_ * a);
121 TimeDelta operator/(int64 a) const {
122 return TimeDelta(delta_ / a);
124 TimeDelta& operator*=(int64 a) {
128 TimeDelta& operator/=(int64 a) {
132 int64 operator/(TimeDelta a) const {
141 bool operator==(TimeDelta other) const {
144 bool operator!=(TimeDelta other) const {
147 bool operator<(TimeDelta other) const {
150 bool operator<=(TimeDelta other) const {
153 bool operator>(TimeDelta other) const {
156 bool operator>=(TimeDelta other) const {
163 friend TimeDelta operator*(int64 a, TimeDelta td);
168 explicit TimeDelta(int64 delta_us) : delta_(delta_us) {
175 inline TimeDelta operator*(int64 a, TimeDelta td) {
176 return TimeDelta(a * td.delta_);
344 TimeDelta operator-(Time other) const {
345 return TimeDelta(us_ - other.us_);
349 Time& operator+=(TimeDelta delta) {
353 Time& operator-=(TimeDelta delta) {
359 Time operator+(TimeDelta delta) const {
362 Time operator-(TimeDelta delta) const {
387 friend class TimeDelta;
415 // Inline the TimeDelta factory methods, for fast TimeDelta construction.
418 inline TimeDelta TimeDelta::FromDays(int64 days) {
419 return TimeDelta(days * Time::kMicrosecondsPerDay);
423 inline TimeDelta TimeDelta::FromHours(int64 hours) {
424 return TimeDelta(hours * Time::kMicrosecondsPerHour);
428 inline TimeDelta TimeDelta::FromMinutes(int64 minutes) {
429 return TimeDelta(minutes * Time::kMicrosecondsPerMinute);
433 inline TimeDelta TimeDelta::FromSeconds(int64 secs) {
434 return TimeDelta(secs * Time::kMicrosecondsPerSecond);
438 inline TimeDelta TimeDelta::FromMilliseconds(int64 ms) {
439 return TimeDelta(ms * Time::kMicrosecondsPerMillisecond);
443 inline TimeDelta TimeDelta::FromMicroseconds(int64 us) {
444 return TimeDelta(us);
447 inline Time TimeDelta::operator+(Time t) const {
494 TimeDelta operator-(TimeTicks other) const {
495 return TimeDelta(ticks_ - other.ticks_);
499 TimeTicks& operator+=(TimeDelta delta) {
503 TimeTicks& operator-=(TimeDelta delta) {
509 TimeTicks operator+(TimeDelta delta) const {
512 TimeTicks operator-(TimeDelta delta) const {
537 friend class TimeDelta;
554 inline TimeTicks TimeDelta::operator+(TimeTicks t) const {