Created
December 12, 2012 14:26
-
-
Save struberg/4268128 to your computer and use it in GitHub Desktop.
set the speed of your CPU to a fixed frequency. This makes benchmarkes much more reproducible.
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/sh | |
if [ "$1" = "ondemand" ]; then | |
echo "setting cpu governer ONDEMAND" | |
for f in /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor | |
do | |
echo ondemand> "$f" | |
done | |
exit | |
else | |
for f in /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor | |
do | |
echo userspace > "$f" | |
done | |
fi | |
for f in /sys/devices/system/cpu/cpu*/cpufreq/scaling_setspeed | |
do | |
echo $1 | |
echo $1 > "$f" | |
done | |
echo 'all CPU cores set to speed' | |
for f in /sys/devices/system/cpu/cpu*/cpufreq/scaling_cur_freq | |
do | |
cat "$f" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment