| 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 <windows.h> | 5 #include <windows.h> |
| 6 #include <mmsystem.h> | 6 #include <mmsystem.h> |
| 7 #include <process.h> | 7 #include <process.h> |
| 8 | 8 |
| 9 #include "base/threading/platform_thread.h" | 9 #include "base/threading/platform_thread.h" |
| 10 #include "base/time.h" | 10 #include "base/time/time.h" |
| 11 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
| 12 | 12 |
| 13 using base::Time; | 13 using base::Time; |
| 14 using base::TimeDelta; | 14 using base::TimeDelta; |
| 15 using base::TimeTicks; | 15 using base::TimeTicks; |
| 16 | 16 |
| 17 namespace { | 17 namespace { |
| 18 | 18 |
| 19 class MockTimeTicks : public TimeTicks { | 19 class MockTimeTicks : public TimeTicks { |
| 20 public: | 20 public: |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 total_drift += drift_microseconds; | 230 total_drift += drift_microseconds; |
| 231 } | 231 } |
| 232 | 232 |
| 233 // Sanity check. We expect some time drift to occur, especially across | 233 // Sanity check. We expect some time drift to occur, especially across |
| 234 // the number of iterations we do. | 234 // the number of iterations we do. |
| 235 EXPECT_LT(0, total_drift); | 235 EXPECT_LT(0, total_drift); |
| 236 | 236 |
| 237 printf("average time drift in microseconds: %lld\n", | 237 printf("average time drift in microseconds: %lld\n", |
| 238 total_drift / kIterations); | 238 total_drift / kIterations); |
| 239 } | 239 } |
| OLD | NEW |