Y
Hacker News
new
|
ask
|
show
|
jobs
Sleep.js: JavaScript port of PHP sleep() function in 6 LOC
(
github.com
)
2 points
by
devhammed
3055 days ago
2 comments
taf2
3055 days ago
This is a really bad idea. CPU burning while you wait. A better approach is setTimeout or requestAnimationFrame.
link
devhammed
3055 days ago
Why @taf2 ? setTimeout is asynchronous, code after it will be executed before the function...requestAnimationFrame is for animations.
link
elsyms
3055 days ago
Why?
link