Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
let intervalId = setInterval(() => {
si.currentLoad().then(data => {
this.setState({ load: data });
});
si.cpuCurrentspeed().then(data => {
this.setState({ speed: data });
});
si.cpuTemperature()
.then(data => {
this.setState({ temp: data });
})
.catch(error => console.error(error));
}, 1000);
this.setState({ intervalId: intervalId });
export const UpdateCPUInfo = () => {
si.cpuCurrentspeed(function(speed) {
si.cpuTemperature(function(temp) {
si.currentLoad(function(load) {
SYSINFO.cpu = {
speed,
temp,
load
}
})
})
})
}