OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 | 5 |
6 // Windows Timer Primer | 6 // Windows Timer Primer |
7 // | 7 // |
8 // A good article: http://www.ddj.com/windows/184416651 | 8 // A good article: http://www.ddj.com/windows/184416651 |
9 // A good mozilla bug: http://bugzilla.mozilla.org/show_bug.cgi?id=363258 | 9 // A good mozilla bug: http://bugzilla.mozilla.org/show_bug.cgi?id=363258 |
10 // | 10 // |
(...skipping 25 matching lines...) Expand all Loading... |
36 | 36 |
37 #include "base/time.h" | 37 #include "base/time.h" |
38 | 38 |
39 #pragma comment(lib, "winmm.lib") | 39 #pragma comment(lib, "winmm.lib") |
40 #include <windows.h> | 40 #include <windows.h> |
41 #include <mmsystem.h> | 41 #include <mmsystem.h> |
42 | 42 |
43 #include "base/basictypes.h" | 43 #include "base/basictypes.h" |
44 #include "base/logging.h" | 44 #include "base/logging.h" |
45 #include "base/cpu.h" | 45 #include "base/cpu.h" |
46 #include "base/singleton.h" | 46 #include "base/memory/singleton.h" |
47 #include "base/synchronization/lock.h" | 47 #include "base/synchronization/lock.h" |
48 | 48 |
49 using base::Time; | 49 using base::Time; |
50 using base::TimeDelta; | 50 using base::TimeDelta; |
51 using base::TimeTicks; | 51 using base::TimeTicks; |
52 | 52 |
53 namespace { | 53 namespace { |
54 | 54 |
55 // From MSDN, FILETIME "Contains a 64-bit value representing the number of | 55 // From MSDN, FILETIME "Contains a 64-bit value representing the number of |
56 // 100-nanosecond intervals since January 1, 1601 (UTC)." | 56 // 100-nanosecond intervals since January 1, 1601 (UTC)." |
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
403 | 403 |
404 // static | 404 // static |
405 int64 TimeTicks::GetQPCDriftMicroseconds() { | 405 int64 TimeTicks::GetQPCDriftMicroseconds() { |
406 return HighResNowSingleton::GetInstance()->GetQPCDriftMicroseconds(); | 406 return HighResNowSingleton::GetInstance()->GetQPCDriftMicroseconds(); |
407 } | 407 } |
408 | 408 |
409 // static | 409 // static |
410 bool TimeTicks::IsHighResClockWorking() { | 410 bool TimeTicks::IsHighResClockWorking() { |
411 return HighResNowSingleton::GetInstance()->IsUsingHighResClock(); | 411 return HighResNowSingleton::GetInstance()->IsUsingHighResClock(); |
412 } | 412 } |
OLD | NEW |