Last active
November 27, 2021 09:44
-
-
Save musaprg/5b5f14f6ab13be0c4b64d281699fd3cd to your computer and use it in GitHub Desktop.
本当はsudo使った方がいいけど諸事情によりsuしか使えない時にCPU-scalingを切ってベンチマークを回す君
This file contains 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
#!/bin/bash | |
set -eu | |
if [ $# -lt 1 ]; then | |
echo "Usage: benchexec <your command>" | |
exit 1 | |
fi | |
echo "Input your root password to change the CPU governor for disabling CPU-scaling." | |
read -s -p "Password: " pass | |
yes "$pass" | su - root -c "cpupower frequency-set --governor performance" | |
$@ | |
yes "$pass" | su - root -c "cpupower frequency-set --governor powersave" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment