optimize the cpu freq
This commit is contained in:
parent
cbaaf9caae
commit
28fb7b97d3
|
@ -297,6 +297,7 @@ public class CpuForm {
|
||||||
CentralProcessor processor = App.si.getHardware().getProcessor();
|
CentralProcessor processor = App.si.getHardware().getProcessor();
|
||||||
|
|
||||||
long[] currentFreq = processor.getCurrentFreq();
|
long[] currentFreq = processor.getCurrentFreq();
|
||||||
|
BigDecimal totalFreq = BigDecimal.ZERO;
|
||||||
|
|
||||||
for (int i = 0; i < currentFreq.length; i++) {
|
for (int i = 0; i < currentFreq.length; i++) {
|
||||||
|
|
||||||
|
@ -305,9 +306,10 @@ public class CpuForm {
|
||||||
String freqStr = divide + " GHz";
|
String freqStr = divide + " GHz";
|
||||||
textField.setText(freqStr);
|
textField.setText(freqStr);
|
||||||
|
|
||||||
// TODO to fix
|
totalFreq = divide.add(totalFreq);
|
||||||
cpuForm.getFreqLabel().setText(freqStr);
|
|
||||||
}
|
}
|
||||||
|
cpuForm.getFreqLabel().setText(String.valueOf(totalFreq.divide(new BigDecimal(4), 2, RoundingMode.HALF_UP)));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue