Is there any way to get a delay in a function

Actually this is a good answer.