| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/globals.h" | 5 #include "vm/globals.h" |
| 6 #if defined(TARGET_OS_WINDOWS) | 6 #if defined(TARGET_OS_WINDOWS) |
| 7 | 7 |
| 8 #include "vm/os.h" | 8 #include "vm/os.h" |
| 9 | 9 |
| 10 #include <malloc.h> // NOLINT | 10 #include <malloc.h> // NOLINT |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 | 125 |
| 126 | 126 |
| 127 int64_t OS::GetCurrentMonotonicTicks() { | 127 int64_t OS::GetCurrentMonotonicTicks() { |
| 128 if (qpc_ticks_per_second == 0) { | 128 if (qpc_ticks_per_second == 0) { |
| 129 // QueryPerformanceCounter not supported, fallback. | 129 // QueryPerformanceCounter not supported, fallback. |
| 130 return GetCurrentTimeMicros(); | 130 return GetCurrentTimeMicros(); |
| 131 } | 131 } |
| 132 // Grab performance counter value. | 132 // Grab performance counter value. |
| 133 LARGE_INTEGER now; | 133 LARGE_INTEGER now; |
| 134 QueryPerformanceCounter(&now); | 134 QueryPerformanceCounter(&now); |
| 135 int64_t qpc_value = static_cast<int64_t>(now.QuadPart); | 135 return static_cast<int64_t>(now.QuadPart); |
| 136 } | 136 } |
| 137 | 137 |
| 138 | 138 |
| 139 int64_t OS::GetCurrentMonotonicFrequency() { | 139 int64_t OS::GetCurrentMonotonicFrequency() { |
| 140 if (qpc_ticks_per_second == 0) { | 140 if (qpc_ticks_per_second == 0) { |
| 141 // QueryPerformanceCounter not supported, fallback. | 141 // QueryPerformanceCounter not supported, fallback. |
| 142 return kMicrosecondsPerSecond; | 142 return kMicrosecondsPerSecond; |
| 143 } | 143 } |
| 144 return qpc_ticks_per_second; | 144 return qpc_ticks_per_second; |
| 145 } | 145 } |
| (...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 408 } | 408 } |
| 409 | 409 |
| 410 | 410 |
| 411 void OS::Exit(int code) { | 411 void OS::Exit(int code) { |
| 412 exit(code); | 412 exit(code); |
| 413 } | 413 } |
| 414 | 414 |
| 415 } // namespace dart | 415 } // namespace dart |
| 416 | 416 |
| 417 #endif // defined(TARGET_OS_WINDOWS) | 417 #endif // defined(TARGET_OS_WINDOWS) |
| OLD | NEW |