Skip to content

Commit

Permalink
JDK-8347267
Browse files Browse the repository at this point in the history
  • Loading branch information
MBaesken committed Jan 9, 2025
1 parent 72f1114 commit 13731a5
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 13731a5

Please sign in to comment.