Index: base/time/time.h |
diff --git a/base/time/time.h b/base/time/time.h |
index 066d910833d2091e60a97870daf0aa7c800dc630..720f9a46efddc26c0b26d4c2d93bc5279f9f4911 100644 |
--- a/base/time/time.h |
+++ b/base/time/time.h |
@@ -642,6 +642,16 @@ BASE_EXPORT std::ostream& operator<<(std::ostream& os, Time time); |
// Represents monotonically non-decreasing clock time. |
class BASE_EXPORT TimeTicks : public time_internal::TimeBase<TimeTicks> { |
public: |
+ // The underlying clock used to generate new TimeTicks. |
+ enum class Clock { |
+ UNKNOWN, |
danakj
2016/03/30 19:51:58
Not sure that you really need the UNKNOWN here. It
charliea (OOO until 10-5)
2016/03/30 20:07:44
Done.
|
+ LINUX_CLOCK_MONOTONIC, |
+ IOS_CF_ABSOLUTE_TIME_MINUS_KERN_BOOTTIME, |
+ MAC_MACH_ABSOLUTE_TIME, |
+ WIN_QPC, |
+ WIN_ROLLOVER_PROTECTED_TIME_GET_TIME |
+ }; |
+ |
TimeTicks() : TimeBase(0) { |
} |
@@ -680,6 +690,11 @@ class BASE_EXPORT TimeTicks : public time_internal::TimeBase<TimeTicks> { |
TimeTicks SnappedToNextTick(TimeTicks tick_phase, |
TimeDelta tick_interval) const; |
+ // Returns an enum indicating the underlying clock being used to generate |
+ // TimeTicks timestamps. This function should only be used for debugging and |
+ // logging purposes. |
+ static Clock GetClock(); |
+ |
#if defined(OS_WIN) |
protected: |
typedef DWORD (*TickFunctionType)(void); |