make time.sh more useful

This commit is contained in:
shaver@mozilla.org 2008-07-21 21:44:21 -04:00
parent f75ac4ed76
commit 4e20ef2007

View File

@ -1,9 +1,13 @@
#!/bin/sh
echo interp:
#!/bin/bash
echo -n interp:' '
for i in 1 2 3 4 5; do
Darwin_OPT.OBJ/js -e 'var d = Date.now(); load("'$1'"); print(Date.now() - d);'
INTERP=`Darwin_OPT.OBJ/js -e 'var d = Date.now(); load("'$1'"); print(Date.now() - d);'`
echo -n $INTERP' '
done
echo jit:
echo -ne '\njit: '
for i in 1 2 3 4 5; do
Darwin_OPT.OBJ/js -j -e 'var d = Date.now(); load("'$1'"); print(Date.now() - d);'
JIT=`Darwin_OPT.OBJ/js -j -e 'var d = Date.now(); load("'$1'"); print(Date.now() - d);'`
echo -n $JIT' '
done
echo -ne '\njit factor: '
(echo scale=2; echo $INTERP / $JIT ) | bc