We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi, based on code from #62 I tried to make sleep to run concurrently like this:
var deasync = require('deasync') setTimeout(function(){ deasync.sleep(250) console.log("deasync works! (1)"); }, 1) setTimeout(function(){ deasync.sleep(250) console.log("deasync works! (2)"); }, 1)
but the code hangs. Is this expected?
The text was updated successfully, but these errors were encountered:
I have similar problem. have a look at this code:
`const sleep = require('deasync').sleep;
setInterval(e => { console.log("1", new Date()); }, 1000); setInterval(e => { sleep(2000); console.log("4", new Date()); }, 4000); `
the code runs and prints:
1 2022-02-17T13:51:31.060Z 1 2022-02-17T13:51:32.062Z 1 2022-02-17T13:51:33.063Z 1 2022-02-17T13:51:36.064Z <-- here the 1 second interval skipped 2 runs 4 2022-02-17T13:51:36.064Z 1 2022-02-17T13:51:37.065Z 1 2022-02-17T13:51:40.062Z <-- skipped again 4 2022-02-17T13:51:40.062Z
Sorry, something went wrong.
No branches or pull requests
Hi,
based on code from #62
I tried to make sleep to run concurrently like this:
but the code hangs.
Is this expected?
The text was updated successfully, but these errors were encountered: