changeset 10445:57175b61dac3

8150843: [windows] os::getTimesSecs() returns negative values for kernel, user times Reviewed-by: dholmes
author stuefe
date Sun, 06 Mar 2016 19:07:57 -0500
parents 3a8da1230500
children f96580a236c0
files src/os/windows/vm/os_windows.cpp
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/os/windows/vm/os_windows.cpp	Sun Mar 06 15:50:13 2016 -0500
+++ b/src/os/windows/vm/os_windows.cpp	Sun Mar 06 19:07:57 2016 -0500
@@ -951,11 +951,11 @@
     FILETIME wt;
     GetSystemTimeAsFileTime(&wt);
     jlong rtc_millis = windows_to_java_time(wt);
-    jlong user_millis = windows_to_java_time(user_time);
-    jlong system_millis = windows_to_java_time(kernel_time);
     *process_real_time = ((double) rtc_millis) / ((double) MILLIUNITS);
-    *process_user_time = ((double) user_millis) / ((double) MILLIUNITS);
-    *process_system_time = ((double) system_millis) / ((double) MILLIUNITS);
+    *process_user_time =
+      (double) jlong_from(user_time.dwHighDateTime, user_time.dwLowDateTime) / (10 * MICROUNITS);
+    *process_system_time =
+      (double) jlong_from(kernel_time.dwHighDateTime, kernel_time.dwLowDateTime) / (10 * MICROUNITS);
     return true;
   } else {
     return false;