| Index: runtime/bin/utils_win.cc
|
| diff --git a/runtime/bin/utils_win.cc b/runtime/bin/utils_win.cc
|
| index ae12f4b420d8d58b38a9a5927f87740f35f68e8e..116ae56157a92739d8569134c04b33b4b60756aa 100644
|
| --- a/runtime/bin/utils_win.cc
|
| +++ b/runtime/bin/utils_win.cc
|
| @@ -187,12 +187,21 @@ static int64_t GetCurrentTimeMicros() {
|
| return (time.t_ - kTimeEpoc) / kTimeScaler;
|
| }
|
|
|
| +static int64_t qpc_ticks_per_second = 0;
|
| +
|
| +void TimerUtils::InitOnce() {
|
| + LARGE_INTEGER ticks_per_sec;
|
| + if (!QueryPerformanceFrequency(&ticks_per_sec)) {
|
| + qpc_ticks_per_second = 0;
|
| + } else {
|
| + qpc_ticks_per_second = static_cast<int64_t>(ticks_per_sec.QuadPart);
|
| + }
|
| +}
|
| +
|
| int64_t TimerUtils::GetCurrentMonotonicMillis() {
|
| return GetCurrentMonotonicMicros() / 1000;
|
| }
|
|
|
| -static int64_t qpc_ticks_per_second = 0;
|
| -
|
| int64_t TimerUtils::GetCurrentMonotonicMicros() {
|
| if (qpc_ticks_per_second == 0) {
|
| // QueryPerformanceCounter not supported, fallback.
|
|
|