Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
jakobegger
on Feb 2, 2015
|
parent
|
context
|
favorite
| on:
What Color Is Your Function?
Yes, I've used a similar technique myself; however I consider it only a last resort. But doesn't that require your language to have threads? Is it possible to do this in eg. Javascript?
totony
on Feb 2, 2015
|
next
[–]
There is no sleep call that i know of in javascript, but you are right it depends on the language and its implementation of sleep.
Edit: although you could emulate a sleep call by setting a (pediodic) timeout
renekooi
on Feb 3, 2015
|
prev
[–]
For node.js, there is a module:
https://www.npmjs.com/package/deasync
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: