Allow setting custom delay function