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

Unified Diff: base/time/time.h

Issue 429743002: Make QPCValueToMicroseconds faster in case the value is less than 44 bits (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add one more test for exactly qpc_value is the threshold Created 6 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
« 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 41d662afa6a908a513d90acaed56d58eaa58d54e..79346f1f0569cab24a99e1f5411cd0008826a28a 100644
--- a/base/time/time.h
+++ b/base/time/time.h
@@ -230,6 +230,11 @@ class BASE_EXPORT Time {
// this global header and put in the platform-specific ones when we remove the
// migration code.
static const int64 kWindowsEpochDeltaMicroseconds;
+#else
+ // To avoid overflow in QPC to Microseconds calculations, since we multiply
+ // by kMicrosecondsPerSecond, then the QPC value should not exceed
+ // (2^63 - 1) / 1E6. If it exceeds that threshold, we divide then multiply.
+ static const int64 kQPCOverflowThreshold = 0x8637BD05AF7;
#endif
// Represents an exploded time that can be formatted nicely. This is kind 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