If I understand you correctly, you need this:
setTimeout(DoSomething ,1000);
Edit thanks to Teemu :
function DoSomething (){ setTimeout(ContinueDoSomething ,1000); } function ContinueDoSomething (){
And even another way may be most effective in some cases:
function DoSomething (){ setTimeout( function(){
source share