--- old/hotspot/src/os/windows/vm/os_windows.cpp 2015-01-12 12:01:29.000000000 +0100 +++ new/hotspot/src/os/windows/vm/os_windows.cpp 2015-01-12 12:01:29.000000000 +0100 @@ -1,5 +1,5 @@ /* - * 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 @@ -839,6 +839,11 @@ 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; @@ -874,6 +879,15 @@ } } +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.