Created
March 11, 2019 21:26
-
-
Save sinamiandashti/a8c9a5bf7e89a0c3a0f00e0bc5d06308 to your computer and use it in GitHub Desktop.
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
function start_progress { | |
while true | |
do | |
echo -ne "#" | |
sleep 1 | |
done | |
} | |
function stop_progress { | |
kill $1 | |
wait $1 2>/dev/null | |
echo -en "\n" | |
} | |
tar_file=tarfile | |
echo -n " PROCESSING CPU PERFORMANCE " | |
dd if=/dev/urandom of=$tar_file bs=1024 count=25000 >>/dev/null 2>&1 | |
start_progress & | |
pid="$!" | |
tf=$( (/usr/bin/time -f "%es" tar cfj $tar_file.bz2 $tar_file) 2>&1 ) | |
stop_progress "$pid" | |
rm -f tarfile* | |
echo $tf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment