diff options
| author | Tianhao Wang <wth@riseup.net> | 2023-11-02 01:14:25 +0100 |
|---|---|---|
| committer | Tianhao Wang <wth@riseup.net> | 2023-11-02 01:14:25 +0100 |
| commit | f3ba79298a26169d6563c42bbd437b903623c599 (patch) | |
| tree | e5b1e91b0a01ac7e99efd1f6424fa7c44af8b3d4 /testall.sh | |
init
Diffstat (limited to 'testall.sh')
| -rw-r--r-- | testall.sh | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/testall.sh b/testall.sh new file mode 100644 index 0000000..922e1bd --- /dev/null +++ b/testall.sh @@ -0,0 +1,28 @@ +runs=100 + +# warm up the machine +for i in $(seq 0 1 $runs) +do + ./test_0 > /dev/null +done + +sum=0 +for i in $(seq 0 1 $runs) +do + sum=$((sum+$(./test_0))) +done + +ref_avg=$((sum / runs)) +echo offset=0 time used: $ref_avg \( 1 \) + +for p in $(seq 1 1 16) +do + sum=0 + for i in $(seq 0 1 $runs) + do + sum=$((sum+$(./test_$p))) + done + avg=$((sum / runs)) + ratio=$(echo $(( 100 * $avg / $ref_avg )) | sed -e 's/..$/.&/;t' -e 's/.$/.0&/') + echo offset=$p time used: $avg \( $ratio \) +done |
