| 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). System-dependent clock interface routines are | 7 // (1601-01-01 00:00:00 UTC). System-dependent clock interface routines are |
| 8 // defined in time_PLATFORM.cc. Note that values for Time may skew and jump | 8 // defined in time_PLATFORM.cc. Note that values for Time may skew and jump |
| 9 // around as the operating system makes adjustments to synchronize (e.g., with | 9 // around as the operating system makes adjustments to synchronize (e.g., with |
| 10 // NTP servers). Thus, client code that uses the Time class must account for | 10 // NTP servers). Thus, client code that uses the Time class must account for |
| (...skipping 772 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 783 // Please use Now() to create a new object. This is for internal use | 783 // Please use Now() to create a new object. This is for internal use |
| 784 // and testing. | 784 // and testing. |
| 785 explicit TimeTicks(int64_t us) : TimeBase(us) {} | 785 explicit TimeTicks(int64_t us) : TimeBase(us) {} |
| 786 }; | 786 }; |
| 787 | 787 |
| 788 // For logging use only. | 788 // For logging use only. |
| 789 BASE_EXPORT std::ostream& operator<<(std::ostream& os, TimeTicks time_ticks); | 789 BASE_EXPORT std::ostream& operator<<(std::ostream& os, TimeTicks time_ticks); |
| 790 | 790 |
| 791 // ThreadTicks ---------------------------------------------------------------- | 791 // ThreadTicks ---------------------------------------------------------------- |
| 792 | 792 |
| 793 // Represents a clock, specific to a particular thread, than runs only while the | 793 // Represents a clock, specific to a particular thread, that runs only while the |
| 794 // thread is running. | 794 // thread is running. |
| 795 class BASE_EXPORT ThreadTicks : public time_internal::TimeBase<ThreadTicks> { | 795 class BASE_EXPORT ThreadTicks : public time_internal::TimeBase<ThreadTicks> { |
| 796 public: | 796 public: |
| 797 ThreadTicks() : TimeBase(0) { | 797 ThreadTicks() : TimeBase(0) { |
| 798 } | 798 } |
| 799 | 799 |
| 800 // Returns true if ThreadTicks::Now() is supported on this system. | 800 // Returns true if ThreadTicks::Now() is supported on this system. |
| 801 static bool IsSupported() WARN_UNUSED_RESULT { | 801 static bool IsSupported() WARN_UNUSED_RESULT { |
| 802 #if (defined(_POSIX_THREAD_CPUTIME) && (_POSIX_THREAD_CPUTIME >= 0)) || \ | 802 #if (defined(_POSIX_THREAD_CPUTIME) && (_POSIX_THREAD_CPUTIME >= 0)) || \ |
| 803 (defined(OS_MACOSX) && !defined(OS_IOS)) || defined(OS_ANDROID) || \ | 803 (defined(OS_MACOSX) && !defined(OS_IOS)) || defined(OS_ANDROID) || \ |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 854 static void WaitUntilInitializedWin(); | 854 static void WaitUntilInitializedWin(); |
| 855 #endif | 855 #endif |
| 856 }; | 856 }; |
| 857 | 857 |
| 858 // For logging use only. | 858 // For logging use only. |
| 859 BASE_EXPORT std::ostream& operator<<(std::ostream& os, ThreadTicks time_ticks); | 859 BASE_EXPORT std::ostream& operator<<(std::ostream& os, ThreadTicks time_ticks); |
| 860 | 860 |
| 861 } // namespace base | 861 } // namespace base |
| 862 | 862 |
| 863 #endif // BASE_TIME_TIME_H_ | 863 #endif // BASE_TIME_TIME_H_ |
| OLD | NEW |