here's an example of a progress indicator made in JSL; it uses a namespace to encapsulate the code. The last few lines are a test, try setting workload bigger or smaller. For smooth performance the progress:set function must be called fairly often. The progress:init function needs to know the total amount of work that will be done to get the percentage right.
Edit: attached a copy of the JSL, apparently the inline JSL may not display correctly.