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

Unified Diff: base/time/time_mac.cc

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: Use IsHighResolution 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 | « base/time/time.h ('k') | base/time/time_posix.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/time/time_mac.cc
diff --git a/base/time/time_mac.cc b/base/time/time_mac.cc
index f0c780449b7b23ae89fbd1cad7d86b3905f88a18..b7bac35bb637168a25cee9cad872165dc08913f1 100644
--- a/base/time/time_mac.cc
+++ b/base/time/time_mac.cc
@@ -237,6 +237,15 @@ bool TimeTicks::IsHighResolution() {
}
// static
+TimeTicks::Clock TimeTicks::GetClock() {
+#if defined(OS_IOS)
+ return Clock::IOS_CF_ABSOLUTE_TIME_MINUS_KERN_BOOTTIME;
+#else
+ return Clock::MAC_MACH_ABSOLUTE_TIME;
+#endif // defined(OS_IOS)
+}
+
+// static
ThreadTicks ThreadTicks::Now() {
return ThreadTicks(ComputeThreadTicks());
}
« no previous file with comments | « base/time/time.h ('k') | base/time/time_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698