optimize the cpu freq

This commit is contained in:
rememberber 2022-02-20 18:34:45 +08:00
parent cbaaf9caae
commit 28fb7b97d3
1 changed files with 4 additions and 2 deletions

View File

@ -297,6 +297,7 @@ public class CpuForm {
CentralProcessor processor = App.si.getHardware().getProcessor();
long[] currentFreq = processor.getCurrentFreq();
BigDecimal totalFreq = BigDecimal.ZERO;
for (int i = 0; i < currentFreq.length; i++) {
@ -305,9 +306,10 @@ public class CpuForm {
String freqStr = divide + " GHz";
textField.setText(freqStr);
// TODO to fix
cpuForm.getFreqLabel().setText(freqStr);
totalFreq = divide.add(totalFreq);
}
cpuForm.getFreqLabel().setText(String.valueOf(totalFreq.divide(new BigDecimal(4), 2, RoundingMode.HALF_UP)));
}