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 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 TimeTicks TimeTicks::Now() { | 252 TimeTicks TimeTicks::Now() { |
253 return TimeTicks(ComputeCurrentTicks()); | 253 return TimeTicks(ComputeCurrentTicks()); |
254 } | 254 } |
255 | 255 |
256 // static | 256 // static |
257 bool TimeTicks::IsHighResolution() { | 257 bool TimeTicks::IsHighResolution() { |
258 return true; | 258 return true; |
259 } | 259 } |
260 | 260 |
261 // static | 261 // static |
| 262 bool TimeTicks::IsConsistentAcrossProcesses() { |
| 263 return true; |
| 264 } |
| 265 |
| 266 // static |
262 TimeTicks::Clock TimeTicks::GetClock() { | 267 TimeTicks::Clock TimeTicks::GetClock() { |
263 #if defined(OS_IOS) | 268 #if defined(OS_IOS) |
264 return Clock::IOS_CF_ABSOLUTE_TIME_MINUS_KERN_BOOTTIME; | 269 return Clock::IOS_CF_ABSOLUTE_TIME_MINUS_KERN_BOOTTIME; |
265 #else | 270 #else |
266 return Clock::MAC_MACH_ABSOLUTE_TIME; | 271 return Clock::MAC_MACH_ABSOLUTE_TIME; |
267 #endif // defined(OS_IOS) | 272 #endif // defined(OS_IOS) |
268 } | 273 } |
269 | 274 |
270 // static | 275 // static |
271 ThreadTicks ThreadTicks::Now() { | 276 ThreadTicks ThreadTicks::Now() { |
272 return ThreadTicks(ComputeThreadTicks()); | 277 return ThreadTicks(ComputeThreadTicks()); |
273 } | 278 } |
274 | 279 |
275 } // namespace base | 280 } // namespace base |
OLD | NEW |