diff --git a/src/jdk.management/windows/native/libmanagement_ext/OperatingSystemImpl.c b/src/jdk.management/windows/native/libmanagement_ext/OperatingSystemImpl.c index 9ff4980f0ba..406ce3fb3bf 100644 --- a/src/jdk.management/windows/native/libmanagement_ext/OperatingSystemImpl.c +++ b/src/jdk.management/windows/native/libmanagement_ext/OperatingSystemImpl.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2025, 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 @@ -50,6 +50,8 @@ #include #pragma warning(pop) +#include + typedef unsigned __int32 juint; typedef unsigned __int64 julong; @@ -215,10 +217,10 @@ static PdhLookupPerfNameByIndexFunc PdhLookupPerfNameByIndex_i; */ typedef struct { HQUERY query; - uint64_t lastUpdate; // Last time query was updated (ticks) + uint64_t lastUpdate; // Last time query was updated (millis) } UpdateQueryS, *UpdateQueryP; -// Min time between query updates (ticks) +// Min time between query updates (millis) static const int MIN_UPDATE_INTERVAL = 500; /* @@ -993,7 +995,7 @@ bindPdhFunctionPointers(HMODULE h) { */ static int getPerformanceData(UpdateQueryP query, HCOUNTER c, PDH_FMT_COUNTERVALUE* value, DWORD format) { - clock_t now = clock(); + uint64_t now = GetTickCount64(); /* * Need to limit how often we update the query