Is there can connect fucnction to delay?

You can’t have delays in functions.

What are you trying to achieve?