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

Unified Diff: base/time/time.h

Issue 2951413003: Add UMA for High Resolution Timer Usage (Closed)
Patch Set: Removed NaCl changes Created 3 years, 5 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_win.cc » ('j') | no next file with comments »
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 3ff215cbbc4132690bc11b41fe2aaec6b7306989..f231cf7010081cefd8e4a78c0e22d8292036aa85 100644
--- a/base/time/time.h
+++ b/base/time/time.h
@@ -549,7 +549,19 @@ class BASE_EXPORT Time : public time_internal::TimeBase<Time> {
// This is provided for testing only, and is not tracked in a thread-safe
// way.
static bool IsHighResolutionTimerInUse();
-#endif
+
+ // The following two functions are used to report the fraction of elapsed time
+ // that the high resolution timer is activated.
+ // ResetHighResolutionTimerUsage() resets the cumulative usage and starts the
+ // measurement interval and GetHighResolutionTimerUsage() returns the
+ // percentage of time since the reset that the high resolution timer was
+ // activated.
+ // ResetHighResolutionTimerUsage() must be called at least once before calling
+ // GetHighResolutionTimerUsage(); otherwise the usage result would be
+ // undefined.
+ static void ResetHighResolutionTimerUsage();
+ static double GetHighResolutionTimerUsage();
+#endif // defined(OS_WIN)
// Converts an exploded structure representing either the local time or UTC
// into a Time class. Returns false on a failure when, for example, a day of
« no previous file with comments | « no previous file | base/time/time_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698