Skip to content

Commit

Permalink
Backport 5e92a4ceafd0626e3600e44a3370ca2f5d9347c8
Browse files Browse the repository at this point in the history
  • Loading branch information
duke committed Feb 5, 2025
1 parent f90566a commit 08736f4
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 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
Expand Down Expand Up @@ -63,6 +63,9 @@ Java_com_sun_management_internal_OperatingSystemImpl_getCpuLoad0

jlong used_delta = used - last_used;
jlong total_delta = total - last_total;
if (total_delta == 0) {
return 0;
}

jdouble cpu = (jdouble) used_delta / total_delta;

Expand Down

0 comments on commit 08736f4

Please sign in to comment.