Switching duration and iterations and removing busy wait