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

Unified Diff: base/time/time.h

Issue 16896018: Enable high resolution time for TimeTicks::Now on Windows Canary (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fix TrackedTime Created 7 years, 4 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
Index: base/time/time.h
diff --git a/base/time/time.h b/base/time/time.h
index af95700ac1eba3727db023c5ef6f8f000eea3add..c3eba0aeefa191887a418c34e9beac1bdad6d000 100644
--- a/base/time/time.h
+++ b/base/time/time.h
@@ -572,6 +572,17 @@ class BASE_EXPORT TimeTicks {
// Returns true if the high resolution clock is working on this system.
// This is only for testing.
static bool IsHighResClockWorking();
+
+ // Enable high resolution time for TimeTicks::Now(). This function will
+ // test for the availability of a working implementation of
+ // QueryPerformanceCounter(). If one is not available, this function does
+ // nothing and the resolution of Now() remains 1ms. Otherwise, all future
+ // calls to TimeTicksNow() will have the higher resolution provided by QPC.
darin (slow to review) 2013/08/12 18:57:36 nit: TimeTicksNow() -> TimeTicks::Now() ?
James Simonsen 2013/08/12 22:57:06 Done.
+ // Returns true if high resolution time was successfully enabled.
+ static bool MaybeEnableHighResNowEverywhere();
darin (slow to review) 2013/08/12 18:57:36 nit: The "Everywhere" suffix could maybe be more p
James Simonsen 2013/08/12 22:57:06 Done.
+
+ // Returns a time value that is NOT rollover protected.
+ static TimeTicks UnprotectedNow();
#endif
// Returns true if this object has not been initialized.

Powered by Google App Engine
This is Rietveld 408576698