Skip to content

Instantly share code, notes, and snippets.

@sgnyjohn
Created August 4, 2019 00:55
Show Gist options
  • Save sgnyjohn/6dc6fc3ac7defafa084e817de07c3bc6 to your computer and use it in GitHub Desktop.
Save sgnyjohn/6dc6fc3ac7defafa084e817de07c3bc6 to your computer and use it in GitHub Desktop.
tests cpu usage from xscreensaver plugins - Energy Star compilant ?
#!/bin/bash
aq=res.txt
echo "" >>$aq
teste() {
local n=$(basename $1)
$1 &
local p=$!
sleep 3
local a1=$(ps aux|grep $n|grep -v grep|awk '{print $3}')
sleep 2
local a2=$(ps aux|grep $n|grep -v grep|awk '{print $3}')
sleep 2
local a3=$(ps aux|grep $n|grep -v grep|awk '{print $3}')
local t="$n $a1 $a2 $a3"
echo "$t"
echo "$t" >>$aq
kill $p
sleep 1
kill $p
}
for i in /usr/lib/xscreensaver/*; do
teste $i
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment