Deving own version of wait_until.