Source

fastestbrowser / fast.sh

Full commit
#!/bin/sh

nrun=10
ft=0
ct=0

if [ $# -lt 1 ]; then

	cat <<!
Disable all your extensions in both Google Chrome and Firefox.
Browsers should not open the last opened window by default.
Firefox: change the dom.allow_scripts_to_close_windows to true in about:config.
Close all Google Chrome and Firefox windows.

Press enter to continue
!
	dd if=/dev/stdin of=/dev/null bs=1 count=1 >/dev/null 2>&1

else if [ "$1" == "-h" ]; then
	echo usage: $0 [-h] [#-of-runs]
else
	nrun=$1
fi


for i in `seq $nrun`; do
	t=`time -f %e ./runbr.sh firefox 2>&1`
	ft=`echo $ft $t + p | dc`
done

for i in `seq $nrun`; do
	t=`time -f %e ./runbr.sh google-chrome 2>&1`
	ct=`echo $ct $t + p | dc`
done

echo 2 k $ft $nrun / p | dc
echo 2 k $ct $nrun / p | dc