OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/time/time.h" | 5 #include "base/time/time.h" |
6 | 6 |
7 #include <CoreFoundation/CFDate.h> | 7 #include <CoreFoundation/CFDate.h> |
8 #include <CoreFoundation/CFTimeZone.h> | 8 #include <CoreFoundation/CFTimeZone.h> |
9 #include <mach/mach.h> | 9 #include <mach/mach.h> |
10 #include <mach/mach_time.h> | 10 #include <mach/mach_time.h> |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 TimeTicks TimeTicks::Now() { | 230 TimeTicks TimeTicks::Now() { |
231 return TimeTicks(ComputeCurrentTicks()); | 231 return TimeTicks(ComputeCurrentTicks()); |
232 } | 232 } |
233 | 233 |
234 // static | 234 // static |
235 bool TimeTicks::IsHighResolution() { | 235 bool TimeTicks::IsHighResolution() { |
236 return true; | 236 return true; |
237 } | 237 } |
238 | 238 |
239 // static | 239 // static |
| 240 TimeTicks::Clock TimeTicks::GetClock() { |
| 241 #if defined(OS_IOS) |
| 242 return Clock::IOS_CF_ABSOLUTE_TIME_MINUS_KERN_BOOTTIME; |
| 243 #else |
| 244 return Clock::MAC_MACH_ABSOLUTE_TIME; |
| 245 #endif // defined(OS_IOS) |
| 246 } |
| 247 |
| 248 // static |
240 ThreadTicks ThreadTicks::Now() { | 249 ThreadTicks ThreadTicks::Now() { |
241 return ThreadTicks(ComputeThreadTicks()); | 250 return ThreadTicks(ComputeThreadTicks()); |
242 } | 251 } |
243 | 252 |
244 } // namespace base | 253 } // namespace base |
OLD | NEW |