OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
461 | 461 |
462 // Returns a platform-dependent high-resolution tick count. Implementation | 462 // Returns a platform-dependent high-resolution tick count. Implementation |
463 // is hardware dependent and may or may not return sub-millisecond | 463 // is hardware dependent and may or may not return sub-millisecond |
464 // resolution. THIS CALL IS GENERALLY MUCH MORE EXPENSIVE THAN Now() AND | 464 // resolution. THIS CALL IS GENERALLY MUCH MORE EXPENSIVE THAN Now() AND |
465 // SHOULD ONLY BE USED WHEN IT IS REALLY NEEDED. | 465 // SHOULD ONLY BE USED WHEN IT IS REALLY NEEDED. |
466 static TimeTicks HighResNow(); | 466 static TimeTicks HighResNow(); |
467 | 467 |
468 #if defined(OS_WIN) | 468 #if defined(OS_WIN) |
469 // Get the absolute value of QPC time drift. For testing. | 469 // Get the absolute value of QPC time drift. For testing. |
470 static int64 GetQPCDriftMicroseconds(); | 470 static int64 GetQPCDriftMicroseconds(); |
| 471 |
| 472 // Returns true if the high resolution clock is working on this system. |
| 473 // This is only for testing. |
| 474 static bool IsHighResClockWorking(); |
471 #endif | 475 #endif |
472 | 476 |
473 // Returns true if this object has not been initialized. | 477 // Returns true if this object has not been initialized. |
474 bool is_null() const { | 478 bool is_null() const { |
475 return ticks_ == 0; | 479 return ticks_ == 0; |
476 } | 480 } |
477 | 481 |
478 // Returns the internal numeric value of the TimeTicks object. | 482 // Returns the internal numeric value of the TimeTicks object. |
479 int64 ToInternalValue() const { | 483 int64 ToInternalValue() const { |
480 return ticks_; | 484 return ticks_; |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
546 #endif | 550 #endif |
547 }; | 551 }; |
548 | 552 |
549 inline TimeTicks TimeDelta::operator+(TimeTicks t) const { | 553 inline TimeTicks TimeDelta::operator+(TimeTicks t) const { |
550 return TimeTicks(t.ticks_ + delta_); | 554 return TimeTicks(t.ticks_ + delta_); |
551 } | 555 } |
552 | 556 |
553 } // namespace base | 557 } // namespace base |
554 | 558 |
555 #endif // BASE_TIME_H_ | 559 #endif // BASE_TIME_H_ |
OLD | NEW |