Lines Matching defs:TimeDelta

10 // TimeDelta represents a duration of time, internally represented in
56 // TimeDelta ------------------------------------------------------------------
58 class BASE_EXPORT TimeDelta {
60 TimeDelta() : delta_(0) {
64 static TimeDelta FromDays(int days);
65 static TimeDelta FromHours(int hours);
66 static TimeDelta FromMinutes(int minutes);
67 static TimeDelta FromSeconds(int64 secs);
68 static TimeDelta FromMilliseconds(int64 ms);
69 static TimeDelta FromSecondsD(double secs);
70 static TimeDelta FromMillisecondsD(double ms);
71 static TimeDelta FromMicroseconds(int64 us);
73 static TimeDelta FromQPCValue(LONGLONG qpc_value);
76 // Converts an integer value representing TimeDelta to a class. This is used
77 // when deserializing a |TimeDelta| structure, using a value known to be
80 static TimeDelta FromInternalValue(int64 delta) {
81 return TimeDelta(delta);
87 static TimeDelta Max();
89 // Returns the internal numeric value of the TimeDelta object. Please don't
121 TimeDelta& operator=(TimeDelta other) {
127 TimeDelta operator+(TimeDelta other) const {
128 return TimeDelta(delta_ + other.delta_);
130 TimeDelta operator-(TimeDelta other) const {
131 return TimeDelta(delta_ - other.delta_);
134 TimeDelta& operator+=(TimeDelta other) {
138 TimeDelta& operator-=(TimeDelta other) {
142 TimeDelta operator-() const {
143 return TimeDelta(-delta_);
148 TimeDelta operator*(int64 a) const {
149 return TimeDelta(delta_ * a);
151 TimeDelta operator/(int64 a) const {
152 return TimeDelta(delta_ / a);
154 TimeDelta& operator*=(int64 a) {
158 TimeDelta& operator/=(int64 a) {
162 int64 operator/(TimeDelta a) const {
171 bool operator==(TimeDelta other) const {
174 bool operator!=(TimeDelta other) const {
177 bool operator<(TimeDelta other) const {
180 bool operator<=(TimeDelta other) const {
183 bool operator>(TimeDelta other) const {
186 bool operator>=(TimeDelta other) const {
193 friend TimeDelta operator*(int64 a, TimeDelta td);
198 explicit TimeDelta(int64 delta_us) : delta_(delta_us) {
205 inline TimeDelta operator*(int64 a, TimeDelta td) {
206 return TimeDelta(a * td.delta_);
419 TimeDelta operator-(Time other) const {
420 return TimeDelta(us_ - other.us_);
424 Time& operator+=(TimeDelta delta) {
428 Time& operator-=(TimeDelta delta) {
434 Time operator+(TimeDelta delta) const {
437 Time operator-(TimeDelta delta) const {
462 friend class TimeDelta;
494 // Inline the TimeDelta factory methods, for fast TimeDelta construction.
497 inline TimeDelta TimeDelta::FromDays(int days) {
501 return TimeDelta(days * Time::kMicrosecondsPerDay);
505 inline TimeDelta TimeDelta::FromHours(int hours) {
509 return TimeDelta(hours * Time::kMicrosecondsPerHour);
513 inline TimeDelta TimeDelta::FromMinutes(int minutes) {
517 return TimeDelta(minutes * Time::kMicrosecondsPerMinute);
521 inline TimeDelta TimeDelta::FromSeconds(int64 secs) {
525 return TimeDelta(secs * Time::kMicrosecondsPerSecond);
529 inline TimeDelta TimeDelta::FromMilliseconds(int64 ms) {
533 return TimeDelta(ms * Time::kMicrosecondsPerMillisecond);
537 inline TimeDelta TimeDelta::FromSecondsD(double secs) {
541 return TimeDelta(secs * Time::kMicrosecondsPerSecond);
545 inline TimeDelta TimeDelta::FromMillisecondsD(double ms) {
549 return TimeDelta(ms * Time::kMicrosecondsPerMillisecond);
553 inline TimeDelta TimeDelta::FromMicroseconds(int64 us) {
557 return TimeDelta(us);
560 inline Time TimeDelta::operator+(Time t) const {
663 TimeDelta operator-(TimeTicks other) const {
664 return TimeDelta(ticks_ - other.ticks_);
668 TimeTicks& operator+=(TimeDelta delta) {
672 TimeTicks& operator-=(TimeDelta delta) {
678 TimeTicks operator+(TimeDelta delta) const {
681 TimeTicks operator-(TimeDelta delta) const {
706 friend class TimeDelta;
722 inline TimeTicks TimeDelta::operator+(TimeTicks t) const {