Skip to content

Instantly share code, notes, and snippets.

@ooZberg
Created November 12, 2017 18:51
Show Gist options
  • Save ooZberg/2508f74e4a47715482d5c55077873ff8 to your computer and use it in GitHub Desktop.
Save ooZberg/2508f74e4a47715482d5c55077873ff8 to your computer and use it in GitHub Desktop.
Alternating 100% and 0% CPU load for simulating heavy computer usage
#!/bin/bash
for (( ; ; ))
do
echo "Working"
for i in $(seq 8)
do
shasum /dev/zero &
done
sleep 5
killall shasum
echo "Sleeping"
sleep 2
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment