Skip to content

Instantly share code, notes, and snippets.

@ayan4m1
Last active September 3, 2023 15:53
Show Gist options
  • Save ayan4m1/30788787942ad91b9de553150b34932d to your computer and use it in GitHub Desktop.
Save ayan4m1/30788787942ad91b9de553150b34932d to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
now=$(date '+%Y%m%d%H%M%S')
echo -e "SecsElapsed,Temp" >> test-${now}.csv
runtime=900
resolution=5
SECONDS=0
while (( $SECONDS < $runtime )); do
cpu_temp=$($(cat /sys/class/thermal/thermal_zone0/temp) / 1000)
echo -e "${SECONDS},${cpu_temp}" >> test-${now}.csv
sleep $resolution
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment