Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

js 实现线程暂停 #26

Open
topcss opened this issue Jun 4, 2019 · 0 comments
Open

js 实现线程暂停 #26

topcss opened this issue Jun 4, 2019 · 0 comments

Comments

@topcss
Copy link
Owner

topcss commented Jun 4, 2019

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

sleep(5000); //当前方法暂停5秒
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant