I need a piece of code to always run independently of other code. Is there a way to create a stream in javascript to run this function?
- why setTimeout doesn't work for me
I tried, but it only works once. And if I call the function recursively, it will cause a "too much recursion" error after some time. I need it to work every 100 million (this is a message with an embedded system).
- as you ask, here is the code
function update(v2) {
dump("update\n");
setTimeout(new function() { update(v2); }, 100);
}
update(this.v);
It produces "too much recursion."
source
share