Switch while to do while loops to investigate performance differences