OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 coordinated universal time (UTC), | 5 // Time represents an absolute point in coordinated universal time (UTC), |
6 // internally represented as microseconds (s/1,000,000) since the Windows epoch | 6 // internally represented as microseconds (s/1,000,000) since the Windows epoch |
7 // (1601-01-01 00:00:00 UTC) (See http://crbug.com/14734). System-dependent | 7 // (1601-01-01 00:00:00 UTC) (See http://crbug.com/14734). System-dependent |
8 // clock interface routines are defined in time_PLATFORM.cc. | 8 // clock interface routines are 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 616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
627 | 627 |
628 #if defined(OS_WIN) | 628 #if defined(OS_WIN) |
629 // Get the absolute value of QPC time drift. For testing. | 629 // Get the absolute value of QPC time drift. For testing. |
630 static int64 GetQPCDriftMicroseconds(); | 630 static int64 GetQPCDriftMicroseconds(); |
631 | 631 |
632 static TimeTicks FromQPCValue(LONGLONG qpc_value); | 632 static TimeTicks FromQPCValue(LONGLONG qpc_value); |
633 | 633 |
634 // Returns true if the high resolution clock is working on this system. | 634 // Returns true if the high resolution clock is working on this system. |
635 // This is only for testing. | 635 // This is only for testing. |
636 static bool IsHighResClockWorking(); | 636 static bool IsHighResClockWorking(); |
637 | |
638 // Returns a time value that is NOT rollover protected. | |
639 static TimeTicks UnprotectedNow(); | |
640 #endif | 637 #endif |
641 | 638 |
642 // Returns true if this object has not been initialized. | 639 // Returns true if this object has not been initialized. |
643 bool is_null() const { | 640 bool is_null() const { |
644 return ticks_ == 0; | 641 return ticks_ == 0; |
645 } | 642 } |
646 | 643 |
647 // Converts an integer value representing TimeTicks to a class. This is used | 644 // Converts an integer value representing TimeTicks to a class. This is used |
648 // when deserializing a |TimeTicks| structure, using a value known to be | 645 // when deserializing a |TimeTicks| structure, using a value known to be |
649 // compatible. It is not provided as a constructor because the integer type | 646 // compatible. It is not provided as a constructor because the integer type |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
734 inline TimeTicks TimeDelta::operator+(TimeTicks t) const { | 731 inline TimeTicks TimeDelta::operator+(TimeTicks t) const { |
735 return TimeTicks(t.ticks_ + delta_); | 732 return TimeTicks(t.ticks_ + delta_); |
736 } | 733 } |
737 | 734 |
738 // For logging use only. | 735 // For logging use only. |
739 BASE_EXPORT std::ostream& operator<<(std::ostream& os, TimeTicks time_ticks); | 736 BASE_EXPORT std::ostream& operator<<(std::ostream& os, TimeTicks time_ticks); |
740 | 737 |
741 } // namespace base | 738 } // namespace base |
742 | 739 |
743 #endif // BASE_TIME_TIME_H_ | 740 #endif // BASE_TIME_TIME_H_ |
OLD | NEW |