javascript flush
category: code [glöplog]
Is there any way in javascript to flush the command queue manually?
how do you mean?
I want a tight loop, but I don't want it hogging all the resources because code is coming into execution queue faster then it's being computed.
plz no jquery
is this on a browser client or on nodejs? i'm assuming it's on client side.
https://developer.mozilla.org/en-US/docs/Web/API/window/requestAnimationFrame is a nice clean way to get new call on a loop without hogging resources.
you can also offload some work to webworkers.
https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Using_web_workers
it really depends on what you're doing exactly though.
https://developer.mozilla.org/en-US/docs/Web/API/window/requestAnimationFrame is a nice clean way to get new call on a loop without hogging resources.
you can also offload some work to webworkers.
https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Using_web_workers
it really depends on what you're doing exactly though.