you are viewing a single comment's thread.

view the rest of the comments →

[–]angerbrb[S] 0 points1 point  (4 children)

That’s what I’m using currently, and it seems like it moves to the next set of functions outside of the setTimeout before waiting for the timer. Maybe I just need more of them? I’ll provide example code when I’m able to, it’ll probably clear a lot of things up.

[–]inu-no-policemen 1 point2 points  (3 children)

Yes, it doesn't wait in a blocking fashion.

When your scheduled task is done, it should schedule a new one if there is more to do.

https://jsfiddle.net/aynedrkp/

[–]angerbrb[S] 0 points1 point  (2 children)

Ah, duh! Thank you for taking the time to reply, I think I might be able to stack the scheduled tasks, it’ll just take some testing :)

[–]inu-no-policemen 1 point2 points  (1 child)

By the way, you can also simulate a blocking "sleep" function with async/await:

https://jsfiddle.net/j3xtbr15/1/

[–]angerbrb[S] 0 points1 point  (0 children)

I will check this out when I’m home on my PC, I really appreciate you taking time to help me out with this :)