summaryrefslogtreecommitdiff
path: root/proffillpix
blob: 7473a3cf8818a0acee164790af68d6d31f63f5b2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/rc
# written by sirjofri, with slight modifications.
rfork en

fn usage {
	echo usage: $0 prog [args] >[1=2]
	exit usage
}

if(~ $#* 0)
	usage

ramfs
cp $1 /tmp
cd /tmp

$* >/dev/null >[2=1]

{
	for(f in prof.*){
#		flambe $1 $f
		prof $1 $f | grep fillpix
	}
} | awk '{ sum += $2; count++; print }
END{
	printf "sum: %.9f\n", sum;
	printf "avg: %.9f\n", sum / count;
}'