I tried to set a flag for running (or not running) that function:
if (!is_calculating) is_calculating = true; else return; my_function(); // do heavy stuff is_calculating = false;
but it’s not working, because it is entering into the code and the web browser enter in an idle status until is finishing. When it is returning, the flag is always OK, because it finished the // do heavy stuff
Can I do something for this behavior? I’d like to jump function execution if a flag is set.