| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 #include "BenchSysTimer_windows.h" | 8 #include "BenchSysTimer_windows.h" |
| 9 | 9 |
| 10 //Time | 10 //Time |
| 11 #define WIN32_LEAN_AND_MEAN 1 | 11 #define WIN32_LEAN_AND_MEAN 1 |
| 12 #include <Windows.h> | 12 #include <windows.h> |
| 13 | 13 |
| 14 static ULONGLONG winCpuTime() { | 14 static ULONGLONG winCpuTime() { |
| 15 FILETIME createTime; | 15 FILETIME createTime; |
| 16 FILETIME exitTime; | 16 FILETIME exitTime; |
| 17 FILETIME usrTime; | 17 FILETIME usrTime; |
| 18 FILETIME sysTime; | 18 FILETIME sysTime; |
| 19 if (0 == GetProcessTimes(GetCurrentProcess() | 19 if (0 == GetProcessTimes(GetCurrentProcess() |
| 20 , &createTime, &exitTime | 20 , &createTime, &exitTime |
| 21 , &sysTime, &usrTime)) | 21 , &sysTime, &usrTime)) |
| 22 { | 22 { |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 | 55 |
| 56 LARGE_INTEGER frequency; | 56 LARGE_INTEGER frequency; |
| 57 if (0 == ::QueryPerformanceFrequency(&frequency)) { | 57 if (0 == ::QueryPerformanceFrequency(&frequency)) { |
| 58 return 0.0L; | 58 return 0.0L; |
| 59 } else { | 59 } else { |
| 60 return static_cast<double>(ticks_elapsed.QuadPart) | 60 return static_cast<double>(ticks_elapsed.QuadPart) |
| 61 / static_cast<double>(frequency.QuadPart) | 61 / static_cast<double>(frequency.QuadPart) |
| 62 * 1000.0L; | 62 * 1000.0L; |
| 63 } | 63 } |
| 64 } | 64 } |
| OLD | NEW |