Last active
October 21, 2024 09:27
-
-
Save adionditsak/b636a4db0509a9c940638863facb1198 to your computer and use it in GitHub Desktop.
Calculate milliwatt per second in Debian
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo -v; old_energy_uj=0 old_time=0; while :; do energy_uj=$(sudo cat /sys/class/powercap/intel-rapl/*/energy_uj); time=$(date +%s%N); echo $(( (energy_uj - old_energy_uj) * 1000000 / (time - old_time) )); old_time=$time old_energy_uj=$energy_uj; sleep 1; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment