Added delay_until and delay_while methods