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

Unified Diff: base/time/time.h

Issue 34623008: Change to calculate the real NTP in TimeTicks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed flaky test Created 7 years, 2 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.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 112c14eab51604a3602fd2beadc18cabe66a5f1d..5c2cf6e26abd8667a03246b6fd038b586071f1a5 100644
--- a/base/time/time.h
+++ b/base/time/time.h
@@ -604,6 +604,14 @@ class BASE_EXPORT TimeTicks {
return TimeTicks(ticks);
}
+ // Get the TimeTick value at the time of the UnixEpoch. This is useful when
+ // you need to relate the value of TimeTicks to a real time and date.
+ // Note: Upon first invocation, this function takes a snapshot of the realtime
+ // clock to establish a reference point. This function will return the same
+ // value for the duration of the application, but will be different in future
+ // application runs.
+ static TimeTicks UnixEpoch();
+
// Returns the internal numeric value of the TimeTicks object.
// For serializing, use FromInternalValue to reconstitute.
int64 ToInternalValue() const {
« no previous file with comments | « no previous file | base/time/time.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698