below function used to set the delay in javascript
js code
setTimeout(function(){ /// content }, 0);
we can declare the delay in 200ms u can use below code
setTimeout(function(){ /// content }, 200);
this 200 represent the waiting time for action performed