Control delay in loop