< prev index next >

hotspot/src/os/windows/vm/os_windows.cpp

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.

@@ -837,10 +837,15 @@
 jlong windows_to_java_time(FILETIME wt) {
   jlong a = jlong_from(wt.dwHighDateTime, wt.dwLowDateTime);
   return (a - offset()) / 10000;
 }
 
+jlong windows_time_stamp(FILETIME wt) {
+  jlong a = jlong_from(wt.dwHighDateTime, wt.dwLowDateTime);
+  return (a - offset());
+}
+
 FILETIME java_to_windows_time(jlong l) {
   jlong a = (l * 10000) + offset();
   FILETIME result;
   result.dwHighDateTime = high(a);
   result.dwLowDateTime  = low(a);

@@ -872,10 +877,19 @@
     GetSystemTimeAsFileTime(&wt);
     return windows_to_java_time(wt);
   }
 }
 
+void os::javaTimeSystemUTC(jlong &seconds, jlong &nanos) {
+  FILETIME wt;
+  GetSystemTimeAsFileTime(&wt);
+  jlong ts = windows_time_stamp(wt); // 10th of micros
+  jlong secs = jlong(ts / 10000000); // 10000 * 1000
+  seconds = secs; 
+  nanos = jlong(ts - (secs*10000000)) * 100;
+}
+
 jlong os::javaTimeNanos() {
   if (!win32::_has_performance_count) {
     return javaTimeMillis() * NANOSECS_PER_MILLISEC; // the best we can do.
   } else {
     LARGE_INTEGER current_count;
< prev index next >