speed measuring fix (added sleep at the end of loop)