Why do we need to do this loop instead of `Kernel.sleep(duration)` ?