summaryrefslogtreecommitdiffhomepage
path: root/bench/loop.sh
blob: ada4579d8440c314749cc104190c6368f83d9c08 (plain)
1
2
3
4
5
6
7
#!/bin/sh
# Pure interpreter speed: arithmetic, tests, variable assignment.
i=0; s=0
while [ $i -lt 200000 ]; do
    s=$((s + i % 7)); i=$((i + 1))
done
echo $s