For example, there is for loop that I want to sleep for some seconds.
$.each(para.res, function (index, item) {
Sleep(100);
});
I know I can use setTimeout or setInterval but both of them are asychronous, the loop will continue, just the function in the setTimeout will run in a few seconds if I do it this way.
$.each(para.res, function (index, item) {
setTimeOut(function(){do something},1000);
});