topcss / my-notes

https://github.com/topcss/my-notes/issues/new

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

js 实现线程暂停

topcss opened this issue · comments

commented
function sleep(d){
  for(var t = Date.now();Date.now() - t <= d;){}
}

sleep(5000); //当前方法暂停5秒