build delay function