Progress

progress(<string> Message)

This function updates a message that appears in the “Background Tasks” window at the bottom of the screen during script execution.  It provides a way for the script progress to be monitored to observe how far script execution has progressed.  A progress message is retained on screen until the next time progress is called.  The overhead of updating the user interface to indicate this progress may slow down the script.  Progress messages should be used sparingly, only when an operation is expected to take more than 1 second.  Not every progress message may be displayed to the user, if the progress messages are sent in quick succession.

Example:

Below is an example of the Progress function used in a loop.

for(var i = 0; i < nEpochs; i++)

{

       progress("Resampling...(" + Math.round(100*i/nEpochs) + "%)");

       epochs[i] = epochs[i].resamp(1000);

       epochs[i].Fs = 1000

       epochs[i].DomainUnit = "Percent";

}

This loop goes through an array of windows and re-samples each window to 1000 Hz.  The progress string is updated every time a new window is about to be re-sampled, showing the user what percentage of the loop is done.