Delay function is not working

You have to understand the concept of asynchronous processing
See also

Taifun