Skip to content

Commit

Permalink
Clean up cputemp.
Browse files Browse the repository at this point in the history
  • Loading branch information
cyoung committed Oct 10, 2017
1 parent 2fc134a commit 4de2420
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions main/cputemp.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ and often times reading this file hangs quite some time. */
func cpuTempMonitor(updater CpuTempUpdateFunc) {
timer := time.NewTicker(1 * time.Second)
for {
<-timer.C

// Update CPUTemp.
temp, err := ioutil.ReadFile("/sys/class/thermal/thermal_zone0/temp")
tempStr := strings.Trim(string(temp), "\n")
Expand All @@ -38,7 +36,7 @@ func cpuTempMonitor(updater CpuTempUpdateFunc) {
if t >= invalidCpuTemp { // Only update if valid value was obtained.
updater(t)
}

<-timer.C
}
}

Expand Down

0 comments on commit 4de2420

Please sign in to comment.