OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Time represents an absolute point in time, internally represented as | 5 // Time represents an absolute point in time, internally represented as |
6 // microseconds (s/1,000,000) since a platform-dependent epoch. Each | 6 // microseconds (s/1,000,000) since a platform-dependent epoch. Each |
7 // platform's epoch, along with other system-dependent clock interface | 7 // platform's epoch, along with other system-dependent clock interface |
8 // routines, is defined in time_PLATFORM.cc. | 8 // routines, is defined in time_PLATFORM.cc. |
9 // | 9 // |
10 // TimeDelta represents a duration of time, internally represented in | 10 // TimeDelta represents a duration of time, internally represented in |
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
368 // SOME HARDWARE and is designed to be used for profiling and perf testing | 368 // SOME HARDWARE and is designed to be used for profiling and perf testing |
369 // only (see the impl for more information). | 369 // only (see the impl for more information). |
370 static TimeTicks UnreliableHighResNow(); | 370 static TimeTicks UnreliableHighResNow(); |
371 | 371 |
372 | 372 |
373 // Returns true if this object has not been initialized. | 373 // Returns true if this object has not been initialized. |
374 bool is_null() const { | 374 bool is_null() const { |
375 return ticks_ == 0; | 375 return ticks_ == 0; |
376 } | 376 } |
377 | 377 |
| 378 // Returns the internal numeric value of the TimeTicks object. |
| 379 int64 ToInternalValue() const { |
| 380 return ticks_; |
| 381 } |
| 382 |
378 TimeTicks& operator=(TimeTicks other) { | 383 TimeTicks& operator=(TimeTicks other) { |
379 ticks_ = other.ticks_; | 384 ticks_ = other.ticks_; |
380 return *this; | 385 return *this; |
381 } | 386 } |
382 | 387 |
383 // Compute the difference between two times. | 388 // Compute the difference between two times. |
384 TimeDelta operator-(TimeTicks other) const { | 389 TimeDelta operator-(TimeTicks other) const { |
385 return TimeDelta(ticks_ - other.ticks_); | 390 return TimeDelta(ticks_ - other.ticks_); |
386 } | 391 } |
387 | 392 |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
441 static TickFunction tick_function_; | 446 static TickFunction tick_function_; |
442 #endif | 447 #endif |
443 }; | 448 }; |
444 | 449 |
445 inline TimeTicks TimeDelta::operator+(TimeTicks t) const { | 450 inline TimeTicks TimeDelta::operator+(TimeTicks t) const { |
446 return TimeTicks(t.ticks_ + delta_); | 451 return TimeTicks(t.ticks_ + delta_); |
447 } | 452 } |
448 | 453 |
449 #endif // BASE_TIME_H_ | 454 #endif // BASE_TIME_H_ |
450 | 455 |
OLD | NEW |