I have two functions
console.log()
running every second, usingsetInterval()
- a constant loop calculating (eg. repeatedly calculating sha256)
Using asynchronous JavaScript, how can I run both a constant loop and still console.log()
every second.
Everything I’ve tried brought no solution, as the calculating loop always goes to the top of JavaScript’s queue and runs until it I manually stop this loop and then the interval starts going every second
I know that a solution also involves Web Workers, but I would rather like to understand this first.