progress indicator…

I have a function that iterates in JS, and i would like to show its progress visually. However, I seem to be encountering one of these priority walls…
Here is a js and patch that run a simple iteration, but the multislider doesn’t keep up. Is there a way I can show progress?

>
> I have a function that iterates in JS, and i would like to show its
> progress visually. However, I seem to be encountering one of these
> priority walls…
> Here is a js and patch that run a simple iteration, but the
> multislider doesn’t keep up. Is there a way I can show progress?

You need to use a Task to introduce asynchrony–i.e. the multislider
won’t update until the event is done being sent, so break the
operation into chunks that are processed as separate low priority
events. This is similar to "cooperative multithreading".

Josh, thanks for the hints.
I gave this a shot, and didn’t get the results I hoped for!
Here’s a js that uses a task instead of a for loop to copy the file. It just sort of stops after one iteration, even though I specify the task to run 11 times.
Clearly it has to do with my interval of "1", so how do I get it to execute the task asynchronously without guessing at the interval?

I’m also confused about something in the JavascriptInMax documentation (pg 34):
"Although the overall timing accuracy of a Task function is high, the latency between the
scheduled time and the actual execution time of a Task function is variable because the
function runs in a low-priority thread."

BUT LATER on pg 45…

"In summary, a function will execute at in the high-priority thread…
? if the function?s immediate property is set
and
? the js receives a message to invoke the function at high-priority
or
? the function is executing via a js Task object "