the loop conditional should be pre-computed, instead of performing same calculation and sprintf on every iteration.
also..wondering why you have the braces around the push, as there's no control statement..those braces do nothing?
the hardest line to type correctly is: stty erase ^H