Lines Matching full: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(int64 days);
65 static TimeDelta FromHours(int64 hours);
66 static TimeDelta FromMinutes(int64 minutes);
67 static TimeDelta FromSeconds(int64 secs);
68 static TimeDelta FromMilliseconds(int64 ms);
69 static TimeDelta FromMicroseconds(int64 us);
71 static TimeDelta FromQPCValue(LONGLONG qpc_value);
74 // Converts an integer value representing TimeDelta to a class. This is used
75 // when deserializing a |TimeDelta| structure, using a value known to be
78 static TimeDelta FromInternalValue(int64 delta) {
79 return TimeDelta(delta);
82 // Returns the internal numeric value of the TimeDelta object. Please don't
109 TimeDelta& operator=(TimeDelta other) {
115 TimeDelta operator+(TimeDelta other) const {
116 return TimeDelta(delta_ + other.delta_);
118 TimeDelta operator-(TimeDelta other) const {
119 return TimeDelta(delta_ - other.delta_);
122 TimeDelta& operator+=(TimeDelta other) {
126 TimeDelta& operator-=(TimeDelta other) {
130 TimeDelta operator-() const {
131 return TimeDelta(-delta_);
136 TimeDelta operator*(int64 a) const {
137 return TimeDelta(delta_ * a);
139 TimeDelta operator/(int64 a) const {
140 return TimeDelta(delta_ / a);
142 TimeDelta& operator*=(int64 a) {
146 TimeDelta& operator/=(int64 a) {
150 int64 operator/(TimeDelta a) const {
159 bool operator==(TimeDelta other) const {
162 bool operator!=(TimeDelta other) const {
165 bool operator<(TimeDelta other) const {
168 bool operator<=(TimeDelta other) const {
171 bool operator>(TimeDelta other) const {
174 bool operator>=(TimeDelta other) const {
181 friend TimeDelta operator*(int64 a, TimeDelta td);
186 explicit TimeDelta(int64 delta_us) : delta_(delta_us) {
193 inline TimeDelta operator*(int64 a, TimeDelta td) {
194 return TimeDelta(a * td.delta_);
404 TimeDelta operator-(Time other) const {
405 return TimeDelta(us_ - other.us_);
409 Time& operator+=(TimeDelta delta) {
413 Time& operator-=(TimeDelta delta) {
419 Time operator+(TimeDelta delta) const {
422 Time operator-(TimeDelta delta) const {
447 friend class TimeDelta;
489 // Inline the TimeDelta factory methods, for fast TimeDelta construction.
492 inline TimeDelta TimeDelta::FromDays(int64 days) {
493 return TimeDelta(days * Time::kMicrosecondsPerDay);
497 inline TimeDelta TimeDelta::FromHours(int64 hours) {
498 return TimeDelta(hours * Time::kMicrosecondsPerHour);
502 inline TimeDelta TimeDelta::FromMinutes(int64 minutes) {
503 return TimeDelta(minutes * Time::kMicrosecondsPerMinute);
507 inline TimeDelta TimeDelta::FromSeconds(int64 secs) {
508 return TimeDelta(secs * Time::kMicrosecondsPerSecond);
512 inline TimeDelta TimeDelta::FromMilliseconds(int64 ms) {
513 return TimeDelta(ms * Time::kMicrosecondsPerMillisecond);
517 inline TimeDelta TimeDelta::FromMicroseconds(int64 us) {
518 return TimeDelta(us);
521 inline Time TimeDelta::operator+(Time t) const {
602 TimeDelta operator-(TimeTicks other) const {
603 return TimeDelta(ticks_ - other.ticks_);
607 TimeTicks& operator+=(TimeDelta delta) {
611 TimeTicks& operator-=(TimeDelta delta) {
617 TimeTicks operator+(TimeDelta delta) const {
620 TimeTicks operator-(TimeDelta delta) const {
645 friend class TimeDelta;
661 inline TimeTicks TimeDelta::operator+(TimeTicks t) const {