Avoid busy waiting when waiting for the timer