Use adaptive await in place of hard-coded sleep.