#44: Put nanosleep in loop to ensure sleep is for the correct time.