Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2236)

Unified Diff: base/time/time.h

Issue 1824673002: time: Add a static TimeTicks method that returns the underlying clock (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | base/time/time_mac.cc » ('j') | base/time/time_win.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/time/time.h
diff --git a/base/time/time.h b/base/time/time.h
index 066d910833d2091e60a97870daf0aa7c800dc630..4a02265c2de27d71e47fedfdb08caccbe1029049 100644
--- a/base/time/time.h
+++ b/base/time/time.h
@@ -680,6 +680,11 @@ class BASE_EXPORT TimeTicks : public time_internal::TimeBase<TimeTicks> {
TimeTicks SnappedToNextTick(TimeTicks tick_phase,
TimeDelta tick_interval) const;
+ // Returns a string identifier for the underlying clock being used to generate
+ // TimeTicks timestamps (e.g. LINUX_CLOCK_MONOTONIC_MICROS, WIN_QPC_MICROS).
+ // This function should only be used for debugging and logging purposes.
+ static std::string ClockId();
danakj 2016/03/26 00:40:33 it looks like this can return const char*. i kind
charliea (OOO until 10-5) 2016/03/28 15:40:51 Definitely agree that it makes it hard to see the
danakj 2016/03/28 17:53:50 https://code.google.com/p/chromium/codesearch#chro
danakj 2016/03/28 17:54:21 (And I think that such a function would belong in
charliea (OOO until 10-5) 2016/03/28 21:07:36 Done.
+
#if defined(OS_WIN)
protected:
typedef DWORD (*TickFunctionType)(void);
« no previous file with comments | « no previous file | base/time/time_mac.cc » ('j') | base/time/time_win.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698