Open MayamaTakeshi opened 3 years ago
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
Hi, based on code from #62 I tried to make sleep to run concurrently like this:
but the code hangs. Is this expected?